Safe Few-Step Generation via Velocity Editing

Yujin Choi, Jaehong Yoon

arXiv:2606.23267 · 2026-06-23 공개 · arXiv · PDF

flow-matching text-to-image few-step-generation safety-filtering concept-removal velocity-editing risk-score vesflow

Abstract

Flow matching has recently emerged as a strong paradigm for state-of-the-art text-to-image (T2I) generation, enabling high-quality generation with a small number of sampling steps. As these models are increasingly integrated into real-world applications, ensuring safe and non-sensitive content generation has become a critical requirement. However, adapting safety and concept removal methods to this new generation framework remains an open challenge. Specifically, prior methods largely rely on iterative trajectory steering across a number of denoising steps or on CLIP-centric prompt embedding manipulation. These design assumptions pose fundamental bottlenecks for safety in flow matching-based T2I generation, where limited sampling steps constrain iterative correction and modern context-aware text encoders diminish the effectiveness of embedding-level interventions. In this paper, we propose VESFlow, a training-free safety method tailored to flow matching with extremely few sampling steps. Leveraging the fact that flow matching models learn the marginal velocity, we directly edit the velocity field via a safe-conditional posterior. VESFlow steers the trajectory toward safe outputs while leaving the conditioning prompt unchanged. Building on the observation that VESFlow leaves outputs unchanged under benign prompts, we further introduce a risk score-based filtering that bypasses velocity editing to reduce computational cost while preserving benign prompt generation. Based on this filtering, we propose VESFlow+, a stronger variant of VESFlow that not only edits the velocity toward the safe direction, but also pushes it away from the unsafe direction. Experimental results show that VESFlow+ removes the target concept, reducing the attack success rate by NudeNet to 6.3% on Ring-A-Bell and 6.8% on MMA-Diffusion on the 4-step MeanFlow model, while preserving fidelity on benign prompts.

한국어 요약

한 줄 요약

VESFlow는 흐름 매칭 기반 생성 모델에서 안전성을 확보하기 위해 속도장 편집을 활용한 훈련 없는 안전성 향상 방법이다.

핵심 기여도

핵심 아이디어

기존 안전성 방법은 대부분 반복적 트레젝토리 조정이나 CLIP 기반 프롬프트 임베딩 조작에 의존한다. 그러나 흐름 매칭 기반 생성 모델은 샘플링 단계가 극히 적어 반복적 수정이 어렵고, 현대적인 컨텍스트 인식 텍스트 인코더는 임베딩 수준 조작의 효과를 줄인다. 이에 따라, VESFlow는 흐름 매칭 모델이 학습하는 주변 속도(marginal velocity)를 직접 편집하여 안전한 결과를 유도한다. 이는 조건 프롬프트를 변경하지 않으면서도, 최종 생성물이 안전한 영역(S)에 속하도록 트레젝토리를 안내한다.

VESFlow+는 위험 점수(risk score)를 기반으로 위험한 프롬프트를 식별한 후, 안전한 방향으로 끌어당기고 위험한 방향으로 밀어내는 이중 가이드라인을 적용하여 안전성을 강화한다. 이는 기존의 단일 방향 조정보다 효과적이다.

기술적 접근법

주요 결과

의의 및 한계

VESFlow는 흐름 매칭 기반 생성 모델에서 반복적 트레젝토리 조정이나 임베딩 조작에 의존하지 않고, 속도장 수준에서 직접 안전성을 향상시킬 수 있는 새로운 접근법을 제시한다. 특히, 훈련 없이 즉시 적용 가능한 점에서 실용적 가치가 크다.

그러나 VESFlow는 위험 점수 계산에 의존하며, 이는 사용하는 점수 모델의 정확성에 따라 성능이 달라질 수 있다. 또한, 위험한 프롬프트를 식별하지 못하는 경우, 안전성 향상 효과가 제한될 수 있다. VESFlow+는 이 문제를 완화하지만, 여전히 위험 식별에 의존한다는 한계가 존재한다.

실용적 활용

VESFlow는 텍스트-이미지 생성 모델이 포함된 콘텐츠 생성 플랫폼, SNS, 디지털 마케팅 등에서 실시간 안전성 확보에 활용 가능하다. 특히, 흐름 매칭 기반 생성 모델이 사용되는 Stable Diffusion v3, FLUX, MeanFlow 등에 적용 가능하며, 계산 효율성과 생성 품질을 유지하면서도 안전성을 강화할 수 있다.