While Contrastive Language-Image Pre-training (CLIP) model has significantly advanced text-to-image generation, we uncover two notable issues in its application to diffusion models, particularly with the implementation of local embeddings. First, the model disproportionately focuses on word embeddings with less information of the input prompt. Second, local embeddings disrupt the image geometry established by global embeddings at initial timesteps, risking misalignment with the original prompt. To mitigate the identified issues, we introduce two adjustments to cross-attention: sequence-dependent and time-dependent attention calibration. Our method employs simple numerical operations, for which we provide the values, ensuring easy implementation. In the sequence-dependent attention calibration, constants are added to the logits in the cross-attention layer to counterbalance the diminishing attention across the word sequence. The time-dependent attention adjustment enhances the attention towards global embeddings in the initial stages, facilitating better geometry formation. Our experiments on various datasets show that this simple method significantly improves the performance of Stable Diffusion, yielding images that more accurately depict the input prompts.
대조적 언어-이미지 사전 훈련(CLIP) 모델은 텍스트-이미지 생성을 크게 발전시켰지만, 확산 모델에 적용할 때 특히 지역 임베딩 구현과 관련하여 두 가지 주요 문제가 존재함을 보인다. 첫째, 모델은 입력 프롬프트의 정보가 적은 단어 임베딩에 과도하게 집중한다. 둘째, 지역 임베딩은 초기 타임스텝에서 전역 임베딩에 의해 설정된 이미지 구조를 방해하여 원래 프롬프트와의 불일치 할 가능성을 증가시킨다. 이러한 문제를 완화하기 위해, 우리는 교차 어텐션에 시퀀스 의존적 및 시간
의존적 주의 집중 교정이라는 두 가지 조정을 도입한다. 우리의 방법은 간단한 숫자 연산을 사용하며, 쉬운 구현을 보장하기 위해 값을 제공한다. 시퀀스 의존적 주의 집중 교정에서는 교차 어텐션 계층의 로짓에 상수를 추가하여 단어 시퀀스에 걸쳐 줄어드는 주의를 상쇄한다. 시간 의존적 어텐션 조정은 초기 단계에서 전역 임베딩에 대한 어텐션를 강화하여 더 나은 구조 형성을 촉진한다. 다양한 데이터셋에서의 실험은 이 간단한 방법이 안정적 확산의 성능을 크게 향상시키며, 입력
프롬프트를 더 정확하게 묘사하는 이미지를 생성한다는 것을 보여준다.