Адаптивное управление: Бесплатное ускорение условных диффузионных моделей без обучения
Adaptive Guidance: Training-free Acceleration of Conditional Diffusion Models
December 19, 2023
Авторы: Angela Castillo, Jonas Kohler, Juan C. Pérez, Juan Pablo Pérez, Albert Pumarola, Bernard Ghanem, Pablo Arbeláez, Ali Thabet
cs.AI
Аннотация
В данной статье представлено всестороннее исследование роли Classifier-Free Guidance (CFG) в диффузионных моделях с текстовым условием с точки зрения эффективности вывода. В частности, мы отказываемся от стандартного подхода применения CFG на всех этапах диффузии и вместо этого ищем эффективные стратегии управления. Формулируем задачу поиска таких стратегий в рамках дифференцируемого Neural Architecture Search. Наши результаты показывают, что шаги удаления шума, предлагаемые CFG, всё больше соответствуют простым условным шагам, что делает дополнительные вычисления нейронной сети в CFG избыточными, особенно во второй половине процесса удаления шума. На основе этого наблюдения мы предлагаем "Adaptive Guidance" (AG), эффективный вариант CFG, который адаптивно пропускает вычисления сети, когда процесс удаления шума демонстрирует сходимость. Наши эксперименты показывают, что AG сохраняет качество изображений CFG, сокращая при этом вычисления на 25%. Таким образом, AG представляет собой plug-and-play альтернативу Guidance Distillation, достигая 50% ускорения последнего, оставаясь при этом не требующим обучения и сохраняя способность обрабатывать негативные подсказки. Наконец, мы выявляем дополнительные избыточности CFG в первой половине диффузионного процесса, показывая, что полные вычисления нейронной функции могут быть заменены простыми аффинными преобразованиями прошлых оценок градиентов. Этот метод, названный LinearAG, предлагает ещё более дешёвый вывод ценой отклонения от базовой модели. Наши результаты дают представление об эффективности условного процесса удаления шума, что способствует более практичному и быстрому внедрению диффузионных моделей с текстовым условием.
English
This paper presents a comprehensive study on the role of Classifier-Free
Guidance (CFG) in text-conditioned diffusion models from the perspective of
inference efficiency. In particular, we relax the default choice of applying
CFG in all diffusion steps and instead search for efficient guidance policies.
We formulate the discovery of such policies in the differentiable Neural
Architecture Search framework. Our findings suggest that the denoising steps
proposed by CFG become increasingly aligned with simple conditional steps,
which renders the extra neural network evaluation of CFG redundant, especially
in the second half of the denoising process. Building upon this insight, we
propose "Adaptive Guidance" (AG), an efficient variant of CFG, that adaptively
omits network evaluations when the denoising process displays convergence. Our
experiments demonstrate that AG preserves CFG's image quality while reducing
computation by 25%. Thus, AG constitutes a plug-and-play alternative to
Guidance Distillation, achieving 50% of the speed-ups of the latter while being
training-free and retaining the capacity to handle negative prompts. Finally,
we uncover further redundancies of CFG in the first half of the diffusion
process, showing that entire neural function evaluations can be replaced by
simple affine transformations of past score estimates. This method, termed
LinearAG, offers even cheaper inference at the cost of deviating from the
baseline model. Our findings provide insights into the efficiency of the
conditional denoising process that contribute to more practical and swift
deployment of text-conditioned diffusion models.