Daftar Isi

  1. Fused Attention Kernel / Flash Attention
  2. Multi-Head Latent Attention (MLA) — DeepSeek-V2
  3. Latent Diffusion — Stable Diffusion
  4. Flow Matching / Rectified Flow
  5. Vision Language Action (VLA)
  6. RLHF + PPO (Proximal Policy Optimization)
  7. World Model
  8. Schrödinger Bridges

1. Fused Attention Kernel / Flash Attention

Kelebihan: IO-aware attention — ngurangi memory reads/writes antara HBM dan SRAM. Bikin training jadi 2-4× lebih cepat tanpa loss akurasi, enable long-context sampai 128K+ tokens.

Inti Problem

Standard attention (softmax(QK^T)V) punya quadratic complexity O(N²) — tapi masalah yang lebih gede bukan compute-nya, memory bandwidth bottleneck. Setiap langkah attention baca-tulis attention matrix ukuran N×N dari HBM (High Bandwidth Memory) ke SRAM (on-chip cache) bolak-balik. GPU spend more time moving data than computing.

Core Insight — Tiling + Recomputation

Flash Attention (Dao et al., 2022) gak ngubah formula attention, tapi ngubah order of operations:

  1. Tiling: Q, K, V di-split jadi blocks kecil yang muat di SRAM (19MB di A100 vs 40-80GB HBM)
  2. Online softmax: Compute softmax secara incremental per block — gak perlu nunggu full attention matrix selesai
  3. Backward pass recompute: Gak store attention matrix waktu forward → recompute ulang di backward. I/O saving lebih gede dari extra compute
# Pseudocode: Flash Attention forward pass
for Q_block in Q_blocks:
    for K_block, V_block in KV_blocks:  # KV loaded from HBM once
        # Compute partial S = Q_block @ K_block^T in SRAM
        S = Q_block @ K_block.T  # (B_r x d) @ (d x B_c)
 
        # Online softmax — track running max & exp sum
        m_new = max(m, rowmax(S))
        diag = exp(S - m_new)
        P = diag / (exp(m - m_new) * l_seg + rowsum(diag))
 
        # Accumulate output incrementally
        O_block = diag @ V_block + exp(m - m_new) * O_block  # rescale

Varian & Evolusi

VersionKey ImprovementTahun
FlashAttentionBasic tiling + online softmax2022
FlashAttention-2Better parallelism, less non-matmul ops2023
FlashAttention-3 (Hopper)Async WGMMA, FP8 support2024
FlashAttention-BERTOptimized for BERT-length sequences2024

Kelebihan Konkret

  • Memory dari O(N²) → O(N) — gak perlu simpan matriks attention N×N
  • Speedup 2-4× vs standard PyTorch/TensorFlow implementation
  • Precision same — bitwise identical output (floating point error negligible)
  • Enable long context — 128K, 1M tokens jadi feasible
  • Backbone semua model modern: LLaMA, Mistral, GPT-4, Gemini

Tradeoff

  • ⚠️ Implementasi pake CUDA kernel handwritten — not a simple torch.nn.Module drop-in (tapi udah di-wrapped di flash-attn package)
  • ⚠️ Optimalisasi dependent pada GPU architecture (Ampere, Hopper, Blackwell punya tuning beda)

ponytail: Kalau make HuggingFace Transformers ≥4.35, Flash Attention udah built-in lewat attn_implementation="flash_attention_2". Gak perlu manual.


2. Multi-Head Latent Attention (MLA) — DeepSeek-V2

Kelebihan: Low-rank compressed KV cache — ngurangin memory KV cache sampai 75-90% tanpa degrade quality. Ini yang bikin DeepSeek-V2 cost-efficient banget (diklaim 42.5% cheaper than GPT-4).

Problem: KV Cache Banjir

Di inference autoregressive, kita cache semua K dan V dari semua tokens sebelumnya. Dengan batch size besar + long context, KV cache jadi memory bottleneck nomor 1:

  • LLaMA-2 70B: ~400GB KV cache at 32K context
  • DeepSeek-V2: target 128K context → KV cache size gila-gilaan kalau standar MHA

Core Idea: Latent Compression

MLA (DeepSeek-AI, 2024) adalah Multi-Head Attention dengan compressed latent representation untuk KV cache:

  1. Down-projection: Setiap K dan V di-proyeksi ke dimensi rendah (latent space) via matrix down-projection
  2. Cache latent (bukan raw K/V): Yang di-cache adalah compressed latent vector — jauh lebih kecil
  3. Up-projection saat compute: Waktu attention, latent di-decode balik ke K dan V via up-projection
Standard MHA:
  K, V per head: [n_heads × d_head] → disimpan semua
  Cache size per token: O(n_heads × d_head)

MLA:
  k_latent = DownProject(K)   # [d_compressed] — 1/4 sampai 1/8 dari original
  Simpan: k_latent             # jauh lebih kecil
  K_restored = UpProject(k_latent)  # di-decode pas attention compute
  Cache size per token: O(d_compressed) — independent of n_heads

Kenapa Ini Penting

AspekStandard MHAMLA
KV cache per token2 × n_heads × d_head~2 × d_compressed
Ratio (typical)0.125× - 0.25×
Context windowlimited by memory128K+ jadi feasible
Throughputbaseline~2× lebih tinggi di long context

Decoupled RoPE

MLA juga punya trik unik buat decoupled rotary position encoding — RoPE di-aplikasikan pada auxiliary query/key yang kecil, bukan pada main compressed latent. Kenapa? Karena RoPE gak linear-compatible dengan compression. Solusi: RoPE cuma di auxiliary path yang dimension-nya kecil.

Kelebihan Konkret

  • KV cache 75-90% lebih kecil → batch size lebih besar, throughput naik
  • Attention quality setara MHA — compression loss bisa di-training out
  • Decoupled RoPE — kompatibel dengan position encoding modern
  • Key enabler DeepSeek-V2/V3 arsitektur ekonomis
  • Open source — DeepSeek rinci arsitektur dan weight-nya

Tradeoff

  • ⚠️ Extra parameters: down-projection & up-projection matrices
  • ⚠️ Extra compute: butuh 2 linear layers tambahan per attention (tapi ini di-offset sama saving di memory bandwidth)
  • ⠀⚠️ Belum mainstream adoption di luar DeepSeek — butuh implementasi CUDA khusus biar optimal

3. Latent Diffusion — Stable Diffusion

Kelebihan: Diffusion di latent space (bukan pixel space) — komputasi jauh lebih ringan, kualitas tetap high-fidelity. Ini fondasi Stable Diffusion series.

Problem: Pixel Space Diffusion Gak Efisien

Diffusion model pertama (DDPM, 2020) langsung generate pixel 256×256×3. Masalah:

  • Dimensi terlalu gede → compute mahal
  • Perceptual details (tekstur, bayangan) dan semantic content learning-nya campur aduk susah
  • Sampling lambat

Core Idea: Diffuse di Latent, Decode ke Pixel

Latent Diffusion (Rombach et al., 2022) — yang jadi backbone Stable Diffusion — split proses jadi 2 stage:

Stage 1: VAE (Variational Autoencoder)

  • Encoder: kompres gambar 512×512×3 → latent 64×64×4 (≈48× compression!)
  • Decoder: reconstruct latent balik ke pixel
  • VAE di-pretrain terpisah dengan perceptual loss + adversarial loss → hasil rekonstruksi bagus
  • Kenapa ini works: VAE ngurus perceptual compression — detail visual (tekstur, warna). Diffusion cuma urus semantic compression — apa yang ada di gambar.

Stage 2: Diffusion di Latent Space

  • UNet (atau DiT — Diffusion Transformer di SD3/Sora) belajar denoise latent 64×64×4
  • 48× lebih kecil dari pixel 512×512×3 → jauh lebih cepat
  • Conditioning: text embedding dari CLIP/T5 di-cross-attention ke UNet
Pixel space:   512 × 512 × 3  = 786,432 dimensi
Latent space:   64 ×  64 × 4  =  16,384 dimensi  (≈48× lebih kecil!)

Cross-Attention Conditioning

Bedanya latent diffusion sama diffusion biasa: cross-attention sebagai mekanisme conditioning.

text → Text Encoder (CLIP/T5) → text_embedding
                                   ↓
noisy_latent → UNet [self-attn ∘ cross-attn(text_embedding)] → predicted noise

Ini yang bikin Stable Diffusion bisa text-to-image, image-to-image, inpainting, dll — tinggal ganti conditioning modality.

Kelebihan Konkret

  • Compute efficient — 48× lebih kecil dari pixel diffusion
  • Decoupled compression & generation — VAE bisa di-upgrade sendiri tanpa retrain diffusion
  • Flexible conditioning — text, image, depth map, pose, semua masuk lewat cross-attention
  • Multi-resolution support — latent space fixed size, gampang di-rescale
  • Base of entire SD ecosystem — SD1.5, SDXL, SD3, SD3.5, Flux, semuanya di atas latent diffusion

Perkembangan: SD3 → Flux → DiT

ModelDenoiserTahunHighlight
SD1.5UNet + CLIP2022Latent diffusion > breakthrough
SDXLUNet + CLIP + T52023Dual text encoder, bigger UNet
SD3DiT (MMDiT)2024Rectified Flow, Diffusion Transformer
Flux.1DiT + double CLIP+T5202412B params, SOTA quality

Latent Diffusion mengubah ekonomi generasi gambar. Dengan cost minimum buat DALL-E 2), open source bisa compete.


4. Flow Matching / Rectified Flow

Kelebihan: Generate data dengan straight-line trajectory — lebih cepat sampling (1-10 steps, bukan 50-1000). Teori lebih clean dari diffusion, training lebih stabil. Backbone Stable Diffusion 3 & Flux.

Problem: Diffusion Sampling Lambat

Diffusion model butuh banyak steps (50-1000) karena trajectory-nya acak — random walk dari pure noise ke data. Langevin dynamics is inherently inefficient.

Core Idea: Optimal Transport Path

Flow Matching (Lipman et al., 2023) / Rectified Flow (Liu et al., 2023) punya pendekatan beda:

Bukan belajar score function (∇log p), tapi belajar vector field yang straight-line dari noise ke data:

Kuncinya: rectification — proses lurusin trajectory.

  1. Train model buat predict arah dari noise → data (straight line)
  2. Sampling pake model → dapet trajectory agak melengkung
  3. Rectify: pasang trajectory hasil sampling sebagai training data baru
  4. Model belajar jalur yang lebih lurus
  5. Repeat sampai trajectory jadi essentially straight
Step 0: Noise ──╱╲──╱╲──╱╲── Data   (random trial)
Step 1: Noise ───╱╲──╱╲─── Data     (1× rectified)
Step 2: Noise ─────╱╲───── Data     (2× rectified)
Step N: Noise ──────────── Data     (almost straight → 1-step sampling!)

Conditional Flow Matching (CFM)

Dalam prakteknya kita gak bisa langsung predict vector field dari distribusi marginal. Trick: Conditional Flow Matching — define path per-sample:

  • t=0: pure noise
  • t=1: data sample x₁
  • Vector field: — arah straight ke data

Model belajar: — dan conditional objective ini equivalent dengan unconditional (benar secara matematis).

Kelebihan Konkret

  • Very few sampling steps — 1-10 steps vs 50-1000 diffusion
  • Straight trajectory → bisa pake ODE solver sederhana (Euler)
  • Training lebih stabil — gak ada stochastic differential equation, langsung regression
  • Consistency — mapping noise→data deterministic (gak ada randomness per-step)
  • Interpolation — straight line berarti latent space interpolation jadi linear → meaningful
  • Powering SD3, Flux, Sora — model generasi terbaik 2024-2025 pake ini
  • Distillation gampang — karena trajectorynya straight, bisa 1-step (progressive distillation)

Perbandingan: Diffusion vs Flow Matching

AspekDiffusion (DDPM/DDIM)Flow Matching
Training objectiveScore matching (∇log p)Vector field regression
Sampling steps50-10001-50 (≥ 50 setara quality)
TrajectoryCurved, stochasticStraight, deterministic
TeoriSDE-basedODE-based (simpler)
Kecepatan samplingSlowFast (10-50×)
Model examplesSD1.5, DALL-E 3SD3, Flux, Sora

Matriks Transport dan Optimal Transport (OT)

Flow matching terkait erat dengan Optimal Transport — mencari cost-minimizing path antara distribusi. OT memberikan:

  • Non-crossing trajectories — sample paths gak saling tabrak
  • Efficiency — shortest path in Wasserstein space
  • Coupling — natural pairing of noise and data

ponytail: Rectified Flow bisa dilihat sebagai learned OT — model belajar sendiri jalur optimal tanpa perlu compute OT cost explicitly.


5. Vision Language Action (VLA)

Kelebihan: Menyatukan vision, language, dan robot control dalam satu model. Foundation model untuk robotics — robot bisa ngerti instruksi bahasa dan execute actions tanpa fine-tuning tugas-spesifik.

Problem: Robot Model Selama Ini Task-Specific

Sebelum VLA, robot policy biasanya:

  • Trained per-task (grasping → one model, pushing → another)
  • Gak bisa generalisasi ke objek/scenario baru
  • Butuh ribuan demo per task
  • Natural language zero — pake one-hot task ID

Core Idea: Pretrain Multimodal, Finetune ke Action

VLA (Brohan et al., 2023 — RT-2; RT-2, 2023; π₀ (pi-zero), 2024) adalah pendekatan:

  1. Ambil pretrained VLM (Vision Language Model) yang udah tau banyak tentang visual concepts & language semantics (dari internet-scale data)
  2. Tambahkan action head — output bukan cuma teks, tapi juga robot actions (joint angles, end-effector pose, dll)
  3. Finetune dengan robot demonstration data — model belajar mapping dari visual + language → action
Input: [Image] + "Ambil cangkir merah di meja"
  ↓
VLM Backbone (frozen/finetuned) → visual & text features
  ↓
Action Head (trained from scratch) → joint_positions, gripper_state

Key insight: VLM udah ngerti objek, relasi spasial, instruksi bahasa. Yang ditambah cuma how to act.

Arsitektur VLA

RT-2 (Robotic Transformer 2) — Google DeepMind

  • Backbone: PaLI-X (VLM 55B) / PaLM-E
  • Action representation: discretized — action space di-tokenize jadi 256 bins per dimension
  • Training: Web-scale VLM pretrain → robot demonstration finetune (co-finetuning)
  • Emergent skill: bisa generalize ke objek yang gak ada di demo training
["robot", "pick", "red", "apple", "arm", "0.42", "0.15", "0.88", "gripper", "0.0"]
 ↑ VLM text tokens ↑       ↑ action tokens (discretized) ↑

Semua jadi satu sequence — action token special gak beda dari text token. Unified sequence modeling.

π₀ (Pi-Zero) — Physical Intelligence

  • Backbone: VLM pretrained (smaller, lebih efisien)
  • Action: Continuous action + flow matching policy head
  • Flow matching for action: Generate action trajectory dengan few steps (2-4 steps), bukan autoregressive
  • Novel: Combine flow matching di action space dengan VLM
  • Multi-task: Diklaim 10-20 tasks overlap training

Kelebihan Konkret

  • Generalization — bisa handle objek/scenario unseen (transfer dari VLM knowledge)
  • Natural language interface — tinggal bilang “ambil yang biru” bukan koding
  • Semantic understanding — “the apple to the left of the cup” jadi action beneran
  • Multi-task — satu model buat banyak task
  • Rapid adaptation — few-shot dengan some demos
  • Scalable — makin besar VLM backbone, makin bagus robotics performance

Open Problems

  • ⚠️ High compute — inference VLM 55B + action head di robot realtime susah (RT-2 pake TPU di cloud + latensi tinggi)
  • ⚠️ Safety & alignment — action gak boleh hallucinate, beda dengan text generation
  • ⚠️ Latency — butuh on-device inference (Jetson/Orin) — π₀ lebih practical karena model lebih kecil
  • ⚠️ Data bottleneck — robot demonstration masih mahal dan susah dikumpulin (vs text/images)
  • ⚠️ Embodiment gap — sim-to-real transfer masih challenge

VLA Models Timeline

ModelTahunBackboneAction SpaceHighlight
RT-12023TransformerDiscretized 256 binsMulti-task robotics transformer
RT-22023PaLI-X 55BDiscretized + textWeb-scale VLM → robot policy
Octo2024TransformerDiffusion headOpen-source, multi-embodiment
π₀2024VLM + FlowContinuous flow matchingFlow action, efficient inference
RoboCasa2024DiffusionSimulatedLarge-scale simulation data

ponytail: VLA trend mengarah ke action token sebagai first-class citizen di arsitektur transformer — gak perlu nambahin modality-specific decoder.


6. RLHF + PPO (Proximal Policy Optimization)

Kelebihan: Menyesuaikan LLM dengan preferensi manusia — bikin output lebih helpful, harmless, honest. PPO stabil & sample-efficient buat policy optimization di large language models.

Problem: Language Model Gak Tahu Mana yang “Baik”

LLM pretrained cuma belajar next token prediction dari internet — ngerti grammar, fakta, korelasi statistik. Tapi gak ngerti:

  • Mana jawaban yang helpful vs unhelpful
  • Mana yang harmless vs toxic
  • Mana yang honest vs hallucinated

Supervised fine-tuning (SFT) gak cukup — SFT cuma clone style dari human demo, gak bisa belajar preferensi negatif.

RLHF Pipeline

RLHF (Ouyang et al., 2022 — InstructGPT) adalah 3-stage pipeline:

Stage 1: SFT (Supervised Fine-Tuning)

  • Human demos: prompt + ideal response
  • Standard cross-entropy loss
  • Dapet model awal yang relatively helpful
  • Tanpa SFT, RL langsung dari pretrained = model generate gibberish (action space terlalu gede)

Stage 2: Reward Modeling

  • Human rank beberapa responses dari prompt yang sama
  • Reward model: classifier yang predict “which response is better”
  • Train: pairwise ranking loss (Bradley-Terry model)

  • = winning response (preferred by human)
  • = losing response
  • = sigmoid
  • Reward model output: scalar → how good is this response

Kenapa reward model, bukan langsung human feedback?

  • Human feedback expensive & slow
  • Reward model bisa di-deploy buat label otomatis
  • Jadi dense reward — tiap token ada signal-nya

Stage 3: PPO Optimization

PPO (Schulman et al., 2017) optimize model (policy) pake reward dari reward model.

PPO in Detail

PPO adalah RL algorithm dengan clipped surrogate objective — mencegah policy update terlalu besar yang bisa collapse performance.

Intuisi

RL untuk LLM itu unik: action space = vocabulary (~32K-128K tokens), state space = past tokens. Policy = LLM itu sendiri.

PPO buat LLM punya 4 components yang jalan bareng:

1. Policy (Actor) — LLM kita:

  • Generate response given prompt
  • Loss: maximize expected reward MINUS KL penalty

2. Value function (Critic):

  • Predict expected future reward dari state sekarang
  • Trained dengan MSE terhadap actual return
  • Bantu ngurangin variance di gradient estimation

3. Reward signal:

  • Dari reward model:
  • Ditambah KL penalty:
  • KL penalty prevents model dari “reward hacking” — generate output yang dapet reward tinggi tapi gak meaningfully aligned (mis: nulis panjang banget)

4. Generalized Advantage Estimation (GAE):

  • Balances bias-variance tradeoff
  • dimana

Clipped Objective

dimana:

  • — probability ratio
  • clip() — mencegah update terlalu agresif
  • — estimated advantage

Kenapa clipping penting:

  • Kalau policy tiba-tiba ngeboost probability token tertentu (karena dapet reward tinggi dari reward model yang noise), bisa collapse model
  • Clip memastikan update per step ≤ (biasanya 0.2)

PPO vs Other RL Algorithms for LLM

AspectPPOREINFORCEDPO
Sample efficiency✅ Tinggi (on-policy + importance sampling)❌ Rendah (Monte Carlo)✅ Tinggi (offline)
Stability✅ Clipping prevents collapse❌ High variance✅ Implicit
Reward model needed✅ Yes✅ Yes❌ No (preference langsung)
ComplexityTinggi (actor + critic + RM)MediumRendah (1 stage)
Prevalence✅ Standard RLHFRare✅ Popular alternative

RLHF + PPO: Total Loss

Atau dengan implementasi penuh:

  • : clipped policy gradient
  • : value function MSE loss
  • : entropy bonus (encourage exploration)

Kelebihan Konkret

  • Alignment manusia — output lebih helpful, less toxic
  • Tradeoff control — KL penalty tunable: atur seberapa jauh dari base model
  • Dense reward — reward model kasih feedback per-step (vs hanya final)
  • PPO stabil — clipping prevents catastrophic forgetting
  • Scalable — dipake di ChatGPT, Claude, Gemini, LLaMA-2-Chat
  • Sample efficient — on-policy + advantage estimation

Tradeoff

  • ⚠️ Complex pipeline — butuh 4 model (SFT, RM, Actor, Critic) → memory heavy
  • ⚠️ Reward hacking risk — kalau RM gak bagus, model exploit loophole
  • ⚠️ KL collapse — KL terlalu tinggi → model jadi conservative (gak kreatif)
  • ⚠️ PPO hyperparameter sensitive — learning rate, clip range, KL coefficient perlu tuning
  • ⚠️ Komputasi mahal — generate response, compute reward, update policy tiap iterasi

DPO — Alternatif Simplifikasi

Direct Preference Optimization (Rafailov et al., 2023) ngilangin reward model + PPO:

  • Langsung optimize dari preference pairs
  • Implicit reward = log probability ratio
  • Gak perlu reward model — gak perlu PPO — satu stage
  • Tapi: lebih sensitif ke data quality, offline (gak ada exploration)

ponytail: PPO tetap dapet reward signal yang lebih kaya daripada DPO. Tapi buat most use cases, DPO is “good enough” dan jauh lebih simple. Pilih DPO kalau compute terbatas.


7. World Model

Kelebihan: Model yang belajar simulasi internal lingkungan — bisa bayangin konsekuensi action sebelum execute. Enables planning, reasoning, dan sample-efficient learning di RL & robotics.

Definisi

World model adalah learned simulator of the environment’s dynamics:

  • Input: state + action
  • Predict: next state , reward , done
  • Kadang juga predict: latent representation z_t tanpa perlu reconstruct raw observation

Bedanya sama model biasa: bisa di-rollout untuk planning — model di-”dream” atau bayangin trajectory ke depan tanpa perlu interaksi lingkungan nyata.

Kenapa World Model Penting

ProblemSolution dengan World Model
RL butuh banyak trial di environment nyataBisa trial di dream environment — 1000× lebih cepat
Robotics experiments expensive (robot rusak)Planning di latent space dulu baru execute
Model-based RL kurang stabilDreamer family bikin stabil dengan recurrent state space model
Planning butuh forward simulationWorld model = cheap forward simulator

Arsitektur World Model — DreamerV3

DreamerV3 (Hafner et al., 2023) adalah arsitektur world model paling mature dan general (works across 200+ tasks tanpa hyperparameter tuning).

3 komponen utama:

1. World Model Learning (RSSM — Recurrent State Space Model)

    ┌─────────┐      ┌──────────────┐      ┌─────────┐
    │ Encoder │──→   │ Recurrent    │──→   │ Decoder │
    │ (CNN)   │      │ State Model  │      │(pixel)  │
    └─────────┘      └──────────────┘      └─────────┘
         ↑                │    │                 ↓
    observation           │    │          reconstructed
    (image)               │    │            image
                          │    │
                     ┌────┘    └────┐
                     ↓              ↓
               ┌──────────┐  ┌──────────┐
               │ Reward   │  │ Continue │
               │ Predictor│  │ Predictor│
               └──────────┘  └──────────┘

RSSM components:

  • Encoder: — image → latent
  • Recurrent model: — temporal dynamics
  • Decoder: — latent → reconstructed image
  • Reward predictor:
  • Continue predictor: — episode done?

Loss: ELBO (Evidence Lower Bound) — reconstruction + KL regularization + reward/continue prediction.

2. Behavior Learning (Actor-Critic dalam Dream)

Dalam "dream" — latent rollout tanpa environment:

  h₀, z₀ (dari real experience untuk seed)
     ↓
  a₀ ∼ π(a₀ | h₀, z₀)       ← Actor (policy)
     ↓
  h₁ = f(h₀, z₀, a₀)        ← Recurrent model
  z₁ ∼ prior(z₁ | h₁)        ← learned prior (no encoder)
     ↓
  a₁ ∼ π(a₁ | h₁, z₁)
     ↓
  ... (rollout sampai H=15 steps)
     ↓
  Reward predicted: r̂ₜ ∼ p(r_t | h_t, z_t)
  Value estimated: v̂ₜ = V(h_t, z_t)  ← Critic (value function)

Key insight: Waktu behavior learning, world model diam (frozen) — cuma actor-critic yang diupdate. World model udah belajar dynamics-nya.

Actor-critic loss: Return = predicted reward + λ × predicted value (bootstrapped).

3. Planning & Imagination

Setelah world model trained:

  • Imagination rollout: generate ribuan trajectory di latent space (gak perlu render image — cuma latent)
  • Plan: cari action sequence dengan highest predicted return
  • Execute: apply action pertama dari plan, re-plan di step berikutnya (receding horizon / MPC)

Evolusi World Model

ModelTahunKey Innovation
World Models (Ha & Schmidhuber)2018VAE + MDN-RNN + Controller — “dreaming” untuk training
PlaNet2019RSSM — deep planning network
DreamerV12020Actor-critic dalam latent space dream
DreamerV32023Mastering diverse domains without tuning — fixed hyperparameters across 200+ tasks
DayDreamer2023DreamerV3 di real robot — no simulator needed
Genie (DeepMind)2024Foundation world model — dari internet video tanpa action labels

Genie — Foundation World Model

Genie (Bruce et al., 2024) dari DeepMind:

  • Trained from 200K hours of internet video — gak perlu action labels
  • 3 components:
    1. Video tokenizer (VQ-VAE-like)
    2. Latent action model — infer action dari frame differences
    3. Dynamics model — predict next frame given current frame + latent action
  • Emergent: bisa generate interactive game dari prompt gambar/text
  • Gak perlu RL training — world model + latent action = interactive environment

Kelebihan Konkret

  • Sample efficiency — DreamerV3 sample-efficient 10-50× vs model-free RL
  • Planning tanpa environment — coba berbagai skenario di “dream” sebelum execute
  • Domain agnostic — works across Atari, DM Control, Minecraft, robotics
  • DreamerV3 fixed hyperparameters — gak perlu tuning per task
  • Latent rollout cepat — 1000× lebih cepat dari environment real
  • Foundation models (Genie) — bisa belajar world model dari video saja

Tradeoff

  • ⚠️ Model bias — world model imperfect → planning bisa berdasarkan dynamics yang salah
  • ⠀⚠️ Computational overhead — maintain & update world model (vs model-free yang cuma policy)
  • ⚠️ Long-horizon difficulty — world model error accumulate sepanjang rollout → planning horizon terbatas
  • ⠀⚠️ Open-loop vs closed-loop — rollout di world model gak bisa correct dari real observation
  • ⚠️ Safety concern — kalau world model jadi policy backbone, distribution shift bisa bahaya

ponytail: World model trending ke foundation world model — pretrained dari internet video → finetune ke task-specific. Genie & GameGen adalah indikator awal.


8. Schrödinger Bridges

Kelebihan: Optimal path antara noise dan data — melampaui diffusion model dengan principled interpolation antara arbitrary distributions. Bisa generate, translate, dan unify berbagai generative modeling approaches.

Problem: Diffusion Path-nya Belum Optimal

Diffusion model:

  • Path dari noise → data fixed by design (misal: VP-SDE, VE-SDE, sub-VP)
  • Gak di-optimize — simple linear schedule dipilih biar analytically tractable
  • Bukan path terpendek atau termurah — ada jarak yang terbuang

Core Idea: Optimal Transport via Stochastic Control

Schrödinger Bridge (Schrödinger, 1932; Léonard, 2014) adalah entropic optimal transport problem:

Find the most likely path between distributions p₀ (noise) and p₁ (data), given that the underlying process is a Brownian motion.

Intuisi fisik:

  • Bayangin partikel yang bergerak secara random (Brownian motion)
  • Kita tahu distribusi partikel di t=0 (noise) dan t=1 (data)
  • Schrödinger Bridge: find the most probable evolution given these constraints

dimana:

  • : path distribution yang dicari (bridge)
  • : reference path distribution (biasanya Brownian motion / diffusion reference)
  • : set semua path yang mematuhi marginal p₀ dan p₁

Schrödinger Bridge vs Diffusion

AspekDiffusionSchrödinger Bridge
PathFixed by design (linear schedule)Optimized — learn the best path
BoundaryNoise (fixed Gaussian) → dataArbitrary distributions — p₀ dan p₁ bisa apa aja
OptimalitySub-optimalEntropic OT — optimal
CostPath length fixedMinimum KL divergence
SpeedButuh banyak stepsPath lebih lurus → fewer steps
Image translationGak bisa langsung (butuh conditioning)Langung: gambar↔gambar, domain↔domain

Matematika: Dari Diffusion ke Schrödinger Bridge

Diffusion reverse process (score-based):

Score function — ini yang dipelajari model.

Schrödinger Bridge:

dimana dan adalah solusi dari coupled PDEs (HJB + FP):

Inti: Schrödinger Bridge belajar additional drift yang mengarahkan path ke distribusi target.

Iterative Proportional Fitting (IPF) — Algoritma Praktis

Gak perlu solve PDE secara analitis. IPF (Kullback, 1968) adalah algoritma iterative:

  1. Forward (t=0 → t=1): Sample dari p₀, run diffusion forward, adjust berdasarkan mismatch di t=1
  2. Backward (t=1 → t=0): Sample dari p₁, run reverse, adjust berdasarkan mismatch di t=0
  3. Repeat sampai converged
Iterasi 0: Reference path (Brownian motion)
Iterasi 1: Forward adjusted → backward adjusted
Iterasi 2: Forward adjusted lagi → backward adjusted lagi
...
Iterasi N: Converged → Schrödinger Bridge

Ini equivalent dengan Diffusion Schrödinger Bridge — diffusion model yang di-train dengan IPF.

Aplikasi Schrödinger Bridge

1. Image Generation (DSB — Diffusion Schrödinger Bridge)

  • Trained dari Gaussian → ImageNet distribution
  • Path lebih optimal → sample quality sama dengan lebih sedikit steps
  • Bisa generate dari distribusi non-Gaussian (prior arbitrary)

2. Image-to-Image Translation

  • p₀ = distribusi gambar source domain (misal: foto malam)
  • p₁ = distribusi gambar target domain (misal: foto siang)
  • Schrödinger bridge langsung ngelarin path antara dua distribusi ini
  • Gak perlu conditional model terpisah

3. Domain Adaptation / Unpaired Translation

  • Bedanya sama CycleGAN: Schrödinger Bridge punya stochastic optimality guarantee
  • Path didefinisikan secara probabilistik — gak deterministic mapping

4. Molecular Conformation Generation

  • p₀ = distribusi molekul dalam relaxed state
  • p₁ = distribusi dalam active/target state
  • Generate transition path yang physically plausible

5. Time Series Imputation

  • p₀ = distribusi missing segments (noise)
  • p₁ = observed data distribution
  • Bridge bisa interpolate missing data secara optimal

Schrödinger Bridge vs Flow Matching

AspekFlow MatchingSchrödinger Bridge
PathPre-defined (linear) → rectifiedOptimized by IPF
ObjectiveVector field regression + rectificationForward-backward KL minimization
BoundaryGaussian ↔ dataArbitrary distributions
Theoretical depthODE / OTSDE / PDE / Entropic OT
MaturityProduction-ready (SD3, Flux)Research frontier
ComplexityLowHigh (iterative training)

Recent Breakthroughs

PaperYearKey Idea
Diffusion Schrödinger Bridge (DSB)2021IPF + score matching
I²SB (Image-to-Image SB)2022Unpaired translation dengan SB
DSBM (Discrete SB)2023SB untuk discrete data
LightSB2024Fast SB via flow matching objective + SB regularization
SB-Flow2024Unify flow matching & SB — one framework

Kelebihan Konkret

  • Optimal path — lebih straight → sampling lebih cepat
  • Arbitrary boundaries — bukan cuma noise→data, tapi data→data, domain→domain
  • Unifies generative approaches — diffusion, flow matching, OT, semua kasus spesial dari SB
  • Principled interpolation — teori entropic OT kuat
  • Image translation domain adaptation langsung tanpa model tambahan
  • Frontier research — potensi gebrakan di 2025-2026

Tradeoff

  • ⚠️ Iterative training (IPF) — butuh beberapa siklus forward-backward
  • ⚠️ Computationally heavier — setiap iterasi train diffusion model
  • ⚠️ Belum production-ready — mostly di kertas riset, belum di-deploy di produk skala besar
  • ⚠️ Convergence guarantee — IPF converges, tapi kecepatan tergantung problem
  • ⚠️ High barrier — perlu paham SDE, PDE, OT biar bisa implementasi

Perbandingan Seluruh Algoritma

#AlgoritmaDomain UtamaKelebihan Paling UnikTahun Breakout
1Flash AttentionAttention / TrainingMemory O(N) via IO-aware tiling — 2-4× training speedup2022
2Multi-Head Latent AttentionAttention / InferenceKV cache 75-90% lebih kecil via latent compression2024
3Latent DiffusionImage GenerationDiffusion di 48× compressed space — efficient & high quality2022
4Flow MatchingGenerative ModelStraight-line trajectory — 1-50 steps sampling vs 50-10002023
5VLARoboticsUnified vision-language-action — foundation model for robots2023
6RLHF + PPOLLM AlignmentPreference-based alignment — helpful, harmless, honest2022
7World ModelRL / PlanningDream-based planning — 10-50× sample efficiency2020-2023
8Schrödinger BridgeGenerative / OTOptimal path between ANY distributions — beyond diffusion2021-2024
Flash Attention ──→ MLA ──→ Efficient long-context (memory bottleneck solved)
                        ↓
Latent Diffusion ──→ Flow Matching ──→ Schrödinger Bridge
  (pixel → latent)    (curved → straight)  (suboptimal → optimal)
                        ↓
                   VLA ──→ World Model (robotics & planning unification)
                        ↓
              RLHF + PPO ──→ LLM Alignment

Big picture 2024-2026:

  1. Attention menjadi linear atau sub-quadratic — Flash Attention → MLA → mungkin Mamba/state-space hybrid
  2. Generative path menjadi optimal — Diffusion → Flow Matching → Schrödinger Bridge
  3. Unified foundation models — VLM → VLA → World Foundation Models
  4. Efficient alignment — RLHF (PPO) → DPO → Preference Optimization tanpa reward model

Referensi

  1. Dao et al. (2022). “FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness.” NeurIPS 2022.
  2. DeepSeek-AI. (2024). “DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model.” arXiv:2405.04434.
  3. Rombach et al. (2022). “High-Resolution Image Synthesis with Latent Diffusion Models.” CVPR 2022.
  4. Lipman et al. (2023). “Flow Matching for Generative Modeling.” ICLR 2023.
  5. Liu et al. (2023). “Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow.” ICLR 2023.
  6. Brohan et al. (2023). “RT-2: Vision-Language-Action Models Transfer Web Knowledge to Robotic Control.” arXiv:2307.15818.
  7. Ouyang et al. (2022). “Training language models to follow instructions with human feedback.” NeurIPS 2022.
  8. Schulman et al. (2017). “Proximal Policy Optimization Algorithms.” arXiv:1707.06347.
  9. Hafner et al. (2023). “Mastering Diverse Domains through World Models.” arXiv:2301.04104.
  10. De Bortoli et al. (2021). “Diffusion Schrödinger Bridge with Applications to Score-Based Generative Modeling.” NeurIPS 2021.
  11. Rafailov et al. (2023). “Direct Preference Optimization: Your Language Model is Secretly a Reward Model.” NeurIPS 2023.
  12. Bruce et al. (2024). “Genie: Generative Interactive Environments.” arXiv:2402.15391.

Dibuat: 16 Juli 2026 — Sesi deep-dive 8 algoritma AI generatif & foundation model terkini.