논문 해설
Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models
디테일에 악마가 있다: 플로우 모델을 이용한 디테일 인식 생성을 위한 밀도 가이던스
- 연구 문제 확산 모델과 흐름 모델에서 샘플의 로그우도는 이미지의 세부 묘사와 음의 상관을 보이므로, 샘플 밀도를 제어해 사실성과 세부 묘사의 균형을 맞추는 일이 중요합니다.
- 연구 방법 잠재 코드 스케일링이 로그밀도를 단조롭게 바꾸는 조건인 Score Alignment를 세우고, 이를 바탕으로 샘플링 중 로그밀도를 지정값에 맞추는 Density Guidance 생성 ODE를 구성합니다.
- 주요 결과 EDM2에서 −log p_t(x_t)는 PNG 압축 크기와 최대 84%의 상관을 보였고, CIFAR-10 VP-SDE에서는 잠재 코드의 약 97%가 Score Alignment를 만족했습니다. 분위수 매칭은 적은 샘플링 단계에서도 목표 로그밀도와 높은 상관을 보였습니다.
연구 문제: 이미지 세부 묘사와 로그밀도의 관계
확산 모델과 흐름 모델은 잡음을 데이터 분포로 옮겨 고품질 이미지를 만듭니다. 그런데 샘플의 로그우도는 지각적 품질과 맞지 않습니다. 원문은 로그밀도가 높은 샘플이 대체로 매끄럽고 세부 묘사가 적으며, 밀도가 낮은 샘플일수록 질감이 풍부하다고 보고합니다. 따라서 샘플의 밀도를 조절하는 일은 사실성과 세부 묘사의 균형을 맞추는 데 중요합니다. 기존 접근은 세 가지 한계를 가집니다. 이미 제안된 밀도 유도 방법은 선형 드리프트를 가진 SDE 모델에만 유도되고, 정확한 절차가 계산하기 어려워 근사에 의존하며, 가장 높은 우도 영역만 겨냥해 사실적인 이미지를 얻지 못합니다. 이 논문은 이런 한계를 넘어 샘플 밀도를 세밀하게 제어하는 방법을 다룹니다.
Prior Guidance와 Score Alignment 조건
Prior Guidance는 잠재 코드 x_T를 로그 밀도의 점수 방향으로 이동하거나 스케일링한 뒤 디코딩하는 방법입니다. 논문은 이 방법이 로그 p_0(x_0)를 단조롭게 바꾸려면 Score Alignment 조건이 필요하다고 설명합니다. 이 조건은 점수 벡터가 시간에 따라 정렬되어, 디코딩된 곡선의 접선이 로그 p_0의 기울기와 음이 아닌 내적을 가져야 한다는 것입니다. 원문은 이 조건이 CNF 모델에서 검사할 수 있다고 밝히며, 선형 흐름에서는 항상 성립한다고 증명합니다. 이 증명은 선형 드리프트 조건에서만 적용됩니다. 원문은 조건이 일반적으로 항상 성립하지는 않는다고 반례를 들어 보입니다. 조건을 실제로 검사하기 위해 민감도 방정식으로 v_0을 계산하거나, 점수를 모를 때는 Hutchinson 추정을 쓰는 증강 방정식으로 ω_0을 추정합니다.
Density Guidance의 생성 ODE 수정
Density Guidance는 샘플링 중 로그밀도의 시간 변화율을 목표 b_t로 지정하고, 이를 만족하도록 생성 ODE를 수정합니다. 원래 흐름 u_t를 목표 조건에 맞추어 바꾸되, 바뀐 흐름이 원래 흐름에서 가장 덜 벗어나도록 제약 최적화를 풉니다. 그 결과 Eq. 16 형태의 흐름을 얻습니다. 원문은 b_t = −div u_t이면 원래 샘플러로 되돌아간다고 밝힙니다. 또한 이 식은 점수 함수 ∇log p_t를 필요로 합니다. 실제 구현에서는 PF-ODE를 기반으로 점수를 재조정하는 식으로 정리됩니다. 목표 b_t를 어떻게 고를지는 다음 두 절차로 나뉩니다.

Figure 1 . Density guidance controls the amount of detail. Im- ages sampled from the same condition and latent code with differ- ent strengths of guidance. Top: StableDiffusion v2.1 (Rombach et al., 2022). Bottom: EDM2 (Karras et al., 2024b).
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 1쪽에서 그림 영역을 추출했습니다.
Figure 9 . Density Guidance controls the amount of detail. Samples generated with Eq. 23 using the EDM2 model (Karras et al., 2024b).
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.목표 b_t 선택: 명시적과 암묵적 분위수 매칭
명시적 분위수 매칭은 목표 로그밀도를 분위수 q로 정하고, 샘플에서 추정한 분위수 경로 ϕ_t(q)의 시간 미분을 b_t로 둡니다. 이 방법은 조건부 생성에서 클래스마다 로그밀도 분포가 달라 실제 적용이 어렵습니다. 암묵적 분위수 매칭은 분위수 경로를 추정하지 않고, 확산 항을 이용해 b_t(x) = −div u_t(x) − ½g²(t)√(2D)/σ_t² Φ^{-1}(q)를 씁니다. 이 선택은 샘플이 전형적 영역에 머물도록 돕습니다. 이 식을 PF-ODE에 넣으면 점수를 시간과 공간에 따라 재조정하는 Density-Guided Sampling 식이 나옵니다. 원문은 이 샘플링에 추가 비용이 없다고 설명하며, 상관이 가장 강한 구간 [T, t*]에서만 guidance를 적용합니다.

Figure 8 . Different classes have different likelihoods. Left: Dis- tributions of log-likelihoods of 16 randomly selected classes from ImageNet. Right: Distributions of log-likelihoods for “fox” and “whistle” differ significantly.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.확률적 샘플링으로의 확장
Stochastic Density Guidance는 노이즈가 있는 샘플링에서도 로그밀도 변화를 원하는 대로 유지하려는 방법입니다. 원문은 확률적 샘플러에 노이즈 항을 더하고, 점수에 직교하는 투영 행렬 P_t(x)를 곱한 노이즈 항을 사용합니다. 이 투영은 점수 방향의 확률적 변동이 로그밀도를 흔들지 않도록 합니다. 드리프트에는 보정 항을 더해 확률 과정이 올바른 로그밀도 변화를 따르게 합니다. 노이즈를 샘플링 초기에 넣으면 상위 구조가, 후기에 넣으면 세부 묘사가 주로 바뀝니다. 원문은 샘플링 단계가 충분하면 확률적 샘플링에서도 정확한 우도를 얻을 수 있다고 보고합니다.

Figure 10 . Stochastic density guidance increases variation in generated samples whilst maintaining the desired level of detail. Samples generated with Eq. 25. Adding stochasticity early in the sampling process changes high-level features, whereas adding noise later, only affects lower-level detail.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.
Figure 15 . Explicit Quantile Matching obtains exact likelihoods even for stochastic sampling. Top row: small amount of noise; Middle row: medium amount of noise; Bottom row: large amount of noise. The higher the amount of noise in sampling, the more steps need to be taken for the difference between desired log p0 and obtained log p0 to go to zero.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 23쪽에서 그림 영역을 추출했습니다.
Figure 19 . Density guided samples in stochastic sampling. We chose two starting random seeds and for each of them generated 4 random samples with two strategies: adding noise early in the generation (altering high-level detail), or late (low-level detail). For the inner sampling loop, we used the same random seeds across all runs.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 26쪽에서 그림 영역을 추출했습니다.검증: 점수 정렬 비율과 로그밀도-세부 묘사 상관
검증은 먼저 잠재 코드 대부분이 Score Alignment를 만족하는지 확인합니다. CIFAR-10으로 학습한 VP-SDE 모델에서는 약 97%, ImageNet 512 조건부 잠재 확산 모델 EDM2에서는 100%의 잠재 코드가 이 조건을 만족한다고 보고됩니다. 다음으로 EDM2에서 −log p_t(x_t)와 디코딩 이미지의 PNG 압축 크기 PNG(x_0)의 상관을 측정하며, 최대 84%라는 값을 제시합니다. 같은 비교에서 FLIPD는 29%입니다. 상관이 가장 강한 시점은 t 약 0.6, log SNR 1 근처라고 보고됩니다. 증강 감도식 ω_t는 CIFAR-10 VP-SDE에서 참값과 98.8%의 상관을 보였습니다.
이 결과는 해당 모델과 설정에서 얻은 것이며, 다른 데이터나 구조로의 일반화는 보고되지 않았습니다.

Figure 3 . Nearly all xT satisfy the positive score alignment of Eq. 11 across models and datasets.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.
Figure 5 . The augmented sensitivity equations of Eq. 13 accu- rately tracks the score alignment (SA).
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.검증: 분위수 매칭의 샘플링 단계 민감도와 지각 품질
명시적 분위수 매칭에서는 샘플링 단계 수를 늘릴수록 목표 로그밀도와 얻은 값의 차이가 줄어듭니다. 원문은 단계가 32개 정도로 적어도 목표값과 얻은 값의 상관이 99%를 넘는다고 보고합니다. 지각 품질은 NIQE로 평가합니다. NIQE는 참조 이미지 없이 왜곡 정도를 재는 지표입니다. EDM2에서 Density Guidance의 q와 Prior Guidance의 잠재 코드 노름을 바꾸며 측정한 결과, NIQE 점수는 세부 묘사가 적은 이미지를 선호하는 경향을 보였습니다. 따라서 이 지표를 해석할 때는 세부 묘사의 양과 품질 판단이 섞일 수 있다는 점을 고려해야 합니다.

Figure 12 . Explicit Quantile Matching achieves exact likelihoods when step size goes to zero. For all numbers of sampling steps, the correlation between the desired log p0 and the obtained log p0 is above 99%.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.
Figure 20 . Density and Prior Guidance can improve perceptual quality as measured by NIQE score. Left: NIQE scores (lower is better) for both Density and Prior Guidance on the EDM2 model for various values of the hyperparameters (q and ∥xT ∥ respectively) with regular samples as reference in grey. Right: Representative examples of best-scoring hyperparameters. NIQE score seems to favor lower-detail images.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 26쪽에서 그림 영역을 추출했습니다.한계와 적용 범위
이 논문의 핵심 결과는 조건부 성질과 특정 실험 조건에 묶여 있습니다. Score Alignment는 선형 흐름에서는 증명되지만, 원문은 일반적인 경우에 항상 성립하지 않는다고 반례로 보여 줍니다. 반례인 3성분 2차원 가우시안 혼합에서는 같은 1.22배 스케일링이 어떤 잠재 코드에서는 로그 p_0를 감소시키고, 다른 코드에서는 증가시킵니다. 따라서 Prior Guidance를 항상 쓸 수 있는 방법으로 보아서는 안 됩니다. 또한 NIQE 점수는 세부 묘사가 적은 이미지를 선호하는 경향이 있어 품질 해석에 주의가 필요합니다. 상관 수치와 정렬 비율은 CIFAR-10 VP-SDE, EDM2 등 보고된 모델과 설정에서 얻었으며, 다른 모델이나 과제에 그대로 옮길 수 없습니다.

Figure 11 . Prior Guidance is ineffective due to unsatisfied SA condition. For some latent codes: xT = σT z1 scaling the latent code by 1.22 increases log p0(x0), while for others the same scaling leads to a decrease in log p0(x0) (xT = σT z1). It can be seen that the blue lines cross, while the orange lines do not. The same behavior was observed regardless of which SDE was used.
원문 · CC BY 4.0 · Rafał Karczewski, Markus Heinonen, Vikas Garg · Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.논문 정보
- 저자
- Rafał Karczewski, Markus Heinonen, Vikas Garg
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2025년 2월 9일
- 등록일
- 2026년 10월 29일
- 수정일
- 2025년 5월 28일
- 버전
- v2
- arXiv
- 2502.05807
- 분류
- cs.LG
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Diffusion models have emerged as a powerful class of generative models, capable of producing high-quality images by mapping noise to a data distribution. However, recent findings suggest that image likelihood does not align with perceptual quality: high-likelihood samples tend to be smooth, while lower-likelihood ones are more detailed. Controlling sample density is thus crucial for balancing realism and detail. In this paper, we analyze an existing technique, Prior Guidance, which scales the latent code to influence image detail. We introduce score alignment, a condition that explains why this method works and show that it can be tractably checked for any continuous normalizing flow model. We then propose Density Guidance, a principled modification of the generative ODE that enables exact log-density control during sampling. Finally, we extend Density Guidance to stochastic sampling, ensuring precise log-density control while allowing controlled variation in structure or fine details. Our experiments demonstrate that these techniques provide fine-grained control over image detail without compromising sample quality. Code is available at https://github.com/Aalto-QuML/density-guidance.
원문 인용
Rafał Karczewski, Markus Heinonen, Vikas Garg (2025). Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models. arXiv:2502.05807v2. https://arxiv.org/abs/2502.05807v2
BibTeX
@misc{karczewski2025devil,
title = {{Devil is in the Details: Density Guidance for Detail-Aware Generation with Flow Models}},
author = {Rafał Karczewski and Markus Heinonen and Vikas Garg},
year = {2025},
eprint = {2502.05807},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2502.05807v2}
}