"<!DOCTYPE html>\n<html lang=\"zh\" data-theme=\"light\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>fulltext.txt — Vercel Design System</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap\" rel=\"stylesheet\">\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css\">\n<style>\n\n:root {\n  /* Vercel Palette */\n  --geist-foreground: #171717;\n  --geist-background: #ffffff;\n  --geist-secondary: #4d4d4d;\n  --geist-tertiary: #666666;\n  --geist-quaternary: #808080;\n  --geist-border: #ebebeb;\n  --geist-surface-tint: #fafafa;\n  \n  /* Workflow Accents */\n  --develop-blue: #0a72ef;\n  --preview-pink: #de1d8d;\n  --ship-red: #ff5b4f;\n  \n  /* Interactive & Status */\n  --link-blue: #0072f5;\n  --ds-focus-color: hsla(212, 100%, 48%, 1);\n  --badge-blue-bg: #ebf5ff;\n  --badge-blue-text: #0068d6;\n  \n  /* Shadow-as-Border Philosophy */\n  --shadow-border: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(0, 0, 0, 0.16) 0px 0px 0px 1px;\n  --shadow-card: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(0, 0, 0, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.06) 0px 4px 6px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-full: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, rgba(0, 0, 0, 0.04) 0px 8px 8px -8px, #fafafa 0px 0px 0px 1px;\n  --shadow-ring: rgb(235, 235, 235) 0px 0px 0px 1px;\n  \n  /* Radius Scale */\n  --radius-xs: 2px;\n  --radius-sm: 4px;\n  --radius-md: 6px;\n  --radius-lg: 8px;\n  --radius-xl: 12px;\n  --radius-pill: 9999px;\n}\n\n[data-theme=\"dark\"] {\n  --geist-foreground: #ededed;\n  --geist-background: #000000;\n  --geist-secondary: #a1a1a1;\n  --geist-tertiary: #888888;\n  --geist-quaternary: #666666;\n  --geist-border: #222222;\n  --geist-surface-tint: #0a0a0a;\n  \n  --shadow-border: rgba(255, 255, 255, 0.14) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(255, 255, 255, 0.28) 0px 0px 0px 1px;\n  --shadow-card: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.4) 0px 2px 4px, #111111 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(255, 255, 255, 0.2) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 6px 12px, #111111 0px 0px 0px 1px;\n  --shadow-card-full: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 8px 16px -4px, #111111 0px 0px 0px 1px;\n  --shadow-ring: rgb(40, 40, 40) 0px 0px 0px 1px;\n  \n  --badge-blue-bg: rgba(10, 114, 239, 0.15);\n  --badge-blue-text: #70b5ff;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; }\nbody {\n  margin: 0;\n  font-family: \"Geist\", Arial, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  background-color: var(--geist-background);\n  color: var(--geist-foreground);\n  font-feature-settings: \"liga\" 1;\n  -webkit-font-smoothing: antialiased;\n  min-height: 100vh;\n}\n\na {\n  color: inherit;\n  text-decoration: none;\n  transition: color 0.15s ease;\n}\n\n/* 导航栏 (Vercel Clean Sticky Nav) */\n.vercel-nav {\n  position: sticky;\n  top: 0;\n  background-color: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  z-index: 100;\n  padding: 0 24px;\n  height: 64px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n.nav-brand {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n.vercel-triangle {\n  width: 22px;\n  height: 19px;\n  fill: var(--geist-foreground);\n}\n.nav-title {\n  font-size: 16px;\n  font-weight: 600;\n  letter-spacing: -0.32px;\n  color: var(--geist-foreground);\n}\n.nav-badge-pill {\n  font-family: \"Geist Mono\", ui-monospace, monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  background: var(--badge-blue-bg);\n  color: var(--badge-blue-text);\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n}\n\n.nav-links {\n  display: flex;\n  align-items: center;\n  gap: 24px;\n}\n.nav-link {\n  font-size: 14px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.nav-link:hover, .nav-link.active {\n  color: var(--geist-foreground);\n}\n.nav-link.active {\n  font-weight: 600;\n}\n\n.nav-actions {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n\n/* 按钮规范 */\n.btn-primary-dark {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: opacity 0.15s;\n}\n.btn-primary-dark:hover {\n  opacity: 0.9;\n}\n.btn-secondary-white {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: background 0.15s, box-shadow 0.15s;\n}\n.btn-secondary-white:hover {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border-hover);\n}\n.theme-toggle-btn {\n  background: transparent;\n  border: none;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  width: 36px;\n  height: 36px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--geist-foreground);\n}\n\n/* 核心容器 */\n.vercel-container {\n  max-width: 1200px;\n  margin: 0 auto;\n  padding: 56px 24px 100px;\n}\n\n/* Hero Section (Gallery Emptiness + Negative Letter-spacing) */\n.vercel-hero {\n  text-align: center;\n  max-width: 860px;\n  margin: 0 auto 56px;\n}\n.hero-stage-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 4px 14px;\n  border-radius: var(--radius-pill);\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  margin-bottom: 24px;\n}\n.stage-dot {\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n}\n.vercel-hero h1 {\n  font-size: 48px;\n  font-weight: 600;\n  line-height: 1.05;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 16px;\n}\n.vercel-hero p {\n  font-size: 20px;\n  font-weight: 400;\n  line-height: 1.80;\n  color: var(--geist-secondary);\n  margin: 0 auto 28px;\n}\n\n/* Workflow Pipeline (Develop -> Preview -> Ship) */\n.workflow-pipeline {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 768px) {\n  .workflow-pipeline { grid-template-columns: 1fr; }\n}\n.workflow-step {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px 22px;\n  transition: box-shadow 0.2s;\n}\n.workflow-step:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n.step-mono-label {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  margin-bottom: 8px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n.step-title {\n  font-size: 20px;\n  font-weight: 600;\n  letter-spacing: -0.96px;\n  color: var(--geist-foreground);\n  margin-bottom: 6px;\n}\n.step-desc {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n\n/* Metric Cards (Section 4 Spec) */\n.metric-grid {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 900px) {\n  .metric-grid { grid-template-columns: repeat(2, 1fr); }\n}\n.metric-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n}\n.metric-number {\n  font-size: 40px;\n  font-weight: 600;\n  line-height: 1.0;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin-bottom: 8px;\n  font-feature-settings: \"tnum\" 1;\n}\n.metric-label {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.4;\n}\n\n/* VAD 专栏 Banner (Ship Red & Vercel Clean) */\n.vad-showcase {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-xl);\n  padding: 32px;\n  margin-bottom: 48px;\n  position: relative;\n}\n.vad-header-row {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  flex-wrap: wrap;\n  gap: 12px;\n  margin-bottom: 12px;\n}\n.vad-header-row h2 {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  color: var(--geist-foreground);\n  margin: 0;\n}\n.vad-pillars-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n  gap: 14px;\n  margin-top: 24px;\n}\n.vad-pillar-item {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 14px 16px;\n}\n.vad-pillar-title {\n  font-size: 14px;\n  font-weight: 600;\n  color: var(--ship-red);\n  margin-bottom: 4px;\n}\n.vad-pillar-text {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n.vad-filter-bar {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  margin: 24px 0 16px;\n  padding: 12px 16px;\n  background: var(--geist-surface-tint);\n  border-radius: var(--radius-md);\n  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);\n}\n.vad-filter-btn {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  font-weight: 500;\n  padding: 6px 14px;\n  border-radius: 9999px;\n  border: none;\n  background: transparent;\n  color: var(--geist-secondary);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.vad-filter-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0,0,0,0.05);\n}\n.vad-filter-btn.active {\n  background: #171717;\n  color: #ffffff;\n}\n.vad-search-input {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  padding: 7px 12px;\n  border-radius: 6px;\n  border: 1px solid var(--geist-border);\n  background: #ffffff;\n  color: var(--geist-foreground);\n  width: 280px;\n  outline: none;\n  transition: border-color 0.15s, box-shadow 0.15s;\n}\n.vad-search-input:focus {\n  border-color: #0a72ef;\n  box-shadow: 0 0 0 2px rgba(10, 114, 239, 0.2);\n}\n\n/* 控制栏：搜索、视图、筛选 */\n.control-bar {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 24px;\n  flex-wrap: wrap;\n}\n.search-input-wrap {\n  position: relative;\n  flex: 1;\n  max-width: 480px;\n}\n.search-input {\n  width: 100%;\n  height: 40px;\n  padding: 0 38px 0 14px;\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  color: var(--geist-foreground);\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  outline: none;\n  transition: box-shadow 0.15s;\n}\n.search-input:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n.search-kbd {\n  position: absolute;\n  right: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  color: var(--geist-quaternary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n\n.view-switcher {\n  display: flex;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  background: var(--geist-background);\n  padding: 2px;\n}\n.view-btn {\n  background: transparent;\n  border: none;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-tertiary);\n  padding: 6px 12px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n  transition: color 0.15s, background 0.15s;\n}\n.view-btn.active {\n  background: var(--geist-surface-tint);\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 筛选芯片行 (Filter Pill Strip) */\n.filter-group-strip {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin-bottom: 28px;\n  padding: 16px 20px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-lg);\n}\n.filter-row {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  flex-wrap: wrap;\n}\n.filter-label-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  min-width: 68px;\n}\n.pill-badge {\n  background: var(--geist-background);\n  color: var(--geist-secondary);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 3px 12px;\n  border-radius: var(--radius-pill);\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: all 0.15s;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n}\n.pill-badge:hover {\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border-hover);\n}\n.pill-badge.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  font-weight: 600;\n  box-shadow: none;\n}\n.pill-badge.active-blue {\n  background: var(--develop-blue);\n  color: #ffffff;\n  box-shadow: none;\n}\n.pill-badge.active-red {\n  background: var(--ship-red);\n  color: #ffffff;\n  box-shadow: none;\n}\n\n/* Bento Grid Cards (Section 4 & 6 Spec) */\n.card-grid-bento {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  gap: 16px;\n}\n.vercel-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  transition: box-shadow 0.2s, transform 0.2s;\n  text-decoration: none;\n  color: inherit;\n  overflow: hidden;\n  min-width: 0;\n  word-break: break-word;\n}\n.vercel-card:hover {\n  box-shadow: var(--shadow-card-hover);\n  transform: translateY(-2px);\n}\n.card-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin-bottom: 12px;\n  gap: 8px;\n}\n.card-tag-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  letter-spacing: 0.5px;\n}\n.status-pill-badge {\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 500;\n  flex-shrink: 0;\n}\n.pub-accepted { background: #ebfdf2; color: #027a48; }\n.pub-workshop { background: #eff8ff; color: #175cd3; }\n.pub-submitted { background: #fff8e6; color: #b54708; }\n.pub-preprint { background: #f2f4f7; color: #475467; }\n.pub-other { background: #f9f5ff; color: #6941c6; }\n\n[data-theme=\"dark\"] .pub-accepted { background: rgba(2, 122, 72, 0.2); color: #32d583; }\n[data-theme=\"dark\"] .pub-workshop { background: rgba(23, 92, 211, 0.2); color: #84caff; }\n[data-theme=\"dark\"] .pub-submitted { background: rgba(181, 71, 8, 0.2); color: #fec84b; }\n[data-theme=\"dark\"] .pub-preprint { background: rgba(71, 84, 103, 0.2); color: #98a2b3; }\n[data-theme=\"dark\"] .pub-other { background: rgba(105, 65, 198, 0.2); color: #d6bbfb; }\n\n/* 必读标杆徽章 (Vercel Amber Accent) */\n.milestone-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  padding: 2px 7px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 600;\n  white-space: nowrap;\n  flex-shrink: 0;\n  transition: all 0.15s ease;\n}\n.milestone-badge.ms-idea, .milestone-badge:not([class*=\"ms-\"]) {\n  color: #b54708;\n  background: #fff8e6;\n  border: 1px solid rgba(247, 144, 9, 0.35);\n  box-shadow: 0 1px 2px rgba(181, 71, 8, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-idea, [data-theme=\"dark\"] .milestone-badge:not([class*=\"ms-\"]) {\n  color: #fec84b;\n  background: rgba(181, 71, 8, 0.22);\n  border-color: rgba(254, 200, 75, 0.35);\n}\n.milestone-badge.ms-writing {\n  color: #6941c6;\n  background: #f9f5ff;\n  border: 1px solid rgba(105, 65, 198, 0.3);\n  box-shadow: 0 1px 2px rgba(105, 65, 198, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-writing {\n  color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.22);\n  border-color: rgba(214, 187, 251, 0.35);\n}\n.milestone-badge.ms-value {\n  color: #027a48;\n  background: #ebfdf2;\n  border: 1px solid rgba(2, 122, 72, 0.3);\n  box-shadow: 0 1px 2px rgba(2, 122, 72, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-value {\n  color: #32d583;\n  background: rgba(2, 122, 72, 0.22);\n  border-color: rgba(50, 213, 131, 0.35);\n}\n\n/* 论文正文图表与插图卡片样式 (Geist Design) */\n.paper-figure, .article-body figure {\n  margin: 32px auto;\n  text-align: center;\n  max-width: 100%;\n}\n.paper-figure img, .article-body img {\n  max-width: 96%;\n  height: auto;\n  border-radius: var(--radius-md);\n  border: 1px solid var(--geist-border);\n  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);\n  background: #ffffff;\n  transition: transform 0.2s ease, box-shadow 0.2s ease;\n  display: block;\n  margin: 0 auto;\n}\n.paper-figure img:hover, .article-body img:hover {\n  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\n}\n.paper-figure figcaption, .article-body figcaption {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  margin-top: 10px;\n  line-height: 1.6;\n  font-style: italic;\n  max-width: 850px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n/* VAD 视图切换器 View Switcher */\n.vad-view-switcher {\n  display: inline-flex;\n  padding: 3px;\n  background: var(--geist-secondary-bg);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  margin-bottom: 20px;\n  gap: 2px;\n}\n.view-switch-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 6px 14px;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  border-radius: 6px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.view-switch-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0, 0, 0, 0.04);\n}\n[data-theme=\"dark\"] .view-switch-btn:hover {\n  background: rgba(255, 255, 255, 0.06);\n}\n.view-switch-btn.active {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  font-weight: 600;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n/* 关系图谱 Graph View Styles */\n.graph-container {\n  position: relative;\n  width: 100%;\n  height: 720px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);\n  margin-bottom: 40px;\n}\n.graph-toolbar {\n  position: absolute;\n  top: 14px;\n  left: 14px;\n  right: 14px;\n  z-index: 10;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  padding: 8px 14px;\n  border-radius: 8px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  flex-wrap: wrap;\n  gap: 8px;\n}\n.graph-tool-title {\n  font-size: 13px;\n  font-weight: 700;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  color: var(--geist-foreground);\n}\n.graph-filter-group {\n  display: flex;\n  gap: 6px;\n  align-items: center;\n  flex-wrap: wrap;\n}\n.graph-chip {\n  font-size: 11px;\n  padding: 3px 8px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.graph-chip:hover { background: var(--geist-secondary-bg); }\n.graph-chip.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-color: var(--geist-foreground);\n}\n.graph-search-input {\n  padding: 3px 8px;\n  font-size: 11px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  outline: none;\n  width: 150px;\n}\n#vad-graph-svg {\n  width: 100%;\n  height: 100%;\n  cursor: grab;\n}\n#vad-graph-svg:active { cursor: grabbing; }\n.graph-legend {\n  position: absolute;\n  bottom: 14px;\n  left: 14px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  padding: 10px 14px;\n  font-size: 11px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  z-index: 10;\n  line-height: 1.6;\n  pointer-events: none;\n}\n.graph-legend-row { display: flex; align-items: center; gap: 8px; }\n.graph-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }\n.graph-info-drawer {\n  position: absolute;\n  top: 66px;\n  right: 14px;\n  width: 310px;\n  max-height: 620px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  box-shadow: 0 8px 30px rgba(0,0,0,0.12);\n  z-index: 10;\n  padding: 16px;\n  overflow-y: auto;\n  display: none;\n  backdrop-filter: blur(10px);\n  transition: transform 0.2s ease, opacity 0.2s ease;\n}\n.graph-drawer-close {\n  position: absolute;\n  top: 10px;\n  right: 12px;\n  cursor: pointer;\n  font-size: 16px;\n  color: var(--geist-tertiary);\n}\n.graph-drawer-badge {\n  display: inline-block;\n  padding: 2px 6px;\n  border-radius: 4px;\n  font-size: 10px;\n  font-weight: 600;\n  margin-bottom: 6px;\n}\n.graph-drawer-title {\n  font-size: 13px;\n  font-weight: 700;\n  line-height: 1.4;\n  margin-bottom: 8px;\n  color: var(--geist-foreground);\n}\n.graph-drawer-meta {\n  font-size: 11px;\n  color: var(--geist-secondary);\n  margin-bottom: 12px;\n}\n.graph-drawer-core {\n  font-size: 12px;\n  line-height: 1.6;\n  color: var(--geist-foreground);\n  background: var(--geist-secondary-bg);\n  padding: 8px 10px;\n  border-radius: 6px;\n  margin-bottom: 12px;\n  border: 1px solid var(--geist-border);\n}\n.graph-drawer-link {\n  display: block;\n  text-align: center;\n  padding: 7px 12px;\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-radius: 6px;\n  font-size: 12px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: opacity 0.15s ease;\n  margin-bottom: 6px;\n}\n.graph-drawer-link:hover { opacity: 0.85; }\n.graph-drawer-pdf-link {\n  display: block;\n  text-align: center;\n  padding: 6px 12px;\n  background: var(--geist-secondary-bg);\n  color: var(--geist-foreground);\n  border: 1px solid var(--geist-border);\n  border-radius: 6px;\n  font-size: 11px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.graph-drawer-pdf-link:hover { background: var(--geist-border); }\n.node-circle {\n  cursor: pointer;\n  transition: r 0.2s, stroke-width 0.2s;\n}\n.node-label {\n  font-size: 10px;\n  font-weight: 600;\n  fill: var(--geist-foreground);\n  pointer-events: none;\n  text-shadow: 0 1px 2px var(--geist-background);\n}\n.link-line {\n  stroke: var(--geist-border);\n  stroke-opacity: 0.6;\n  stroke-width: 1.2;\n  transition: stroke 0.2s, stroke-width 0.2s, stroke-opacity 0.2s;\n}\n.link-label {\n  font-size: 9px;\n  fill: var(--geist-tertiary);\n  pointer-events: none;\n  text-anchor: middle;\n}\n\n/* 引用框与警示框 Alerts */\n.callout-alert {\n  margin: 20px 0;\n  padding: 14px 18px;\n  border-radius: var(--radius-md);\n  transition: all 0.15s ease;\n}\n.callout-important, .callout-idea {\n  border-left: 4px solid #b54708;\n  background: rgba(181, 71, 8, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(247, 144, 9, 0.3);\n}\n[data-theme=\"dark\"] .callout-important, [data-theme=\"dark\"] .callout-idea {\n  border-left-color: #fec84b;\n  background: rgba(181, 71, 8, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(254, 200, 75, 0.25);\n}\n.callout-writing {\n  border-left: 4px solid #6941c6;\n  background: rgba(105, 65, 198, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(105, 65, 198, 0.3);\n}\n[data-theme=\"dark\"] .callout-writing {\n  border-left-color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(214, 187, 251, 0.25);\n}\n.callout-value {\n  border-left: 4px solid #027a48;\n  background: rgba(2, 122, 72, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(2, 122, 72, 0.3);\n}\n[data-theme=\"dark\"] .callout-value {\n  border-left-color: #32d583;\n  background: rgba(2, 122, 72, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(50, 213, 131, 0.25);\n}\n\n.card-title {\n  font-size: 16.5px;\n  font-weight: 600;\n  line-height: 1.42;\n  letter-spacing: -0.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 10px;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n  hyphens: auto;\n}\n.card-title a {\n  color: var(--geist-foreground);\n  text-decoration: none;\n  display: inline;\n  transition: color 0.15s ease;\n}\n.card-title a:hover {\n  color: var(--develop-blue);\n  text-decoration: none;\n}\n.card-id-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-quaternary);\n  margin-right: 5px;\n}\n.card-meta-row {\n  display: flex;\n  gap: 6px;\n  flex-wrap: wrap;\n  margin-bottom: 12px;\n}\n.meta-token {\n  font-size: 12px;\n  color: var(--geist-tertiary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-ring);\n  padding: 2px 7px;\n  border-radius: var(--radius-sm);\n  white-space: nowrap;\n}\n.card-body-text {\n  font-size: 13.5px;\n  color: var(--geist-secondary);\n  line-height: 1.6;\n  margin-bottom: 16px;\n  flex-grow: 1;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n}\n.card-body-text strong {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n.card-footer {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 14px;\n}\n.card-link-action {\n  font-size: 13.5px;\n  font-weight: 500;\n  color: var(--link-blue);\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.card-link-action:hover {\n  opacity: 0.85;\n  transform: translateX(2px);\n}\na.meta-token {\n  transition: all 0.15s ease;\n  cursor: pointer;\n  text-decoration: none;\n}\na.meta-token:hover {\n  background: var(--geist-selection);\n  color: var(--geist-foreground);\n  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);\n}\n\n/* 紧凑列表视图 (List View) */\n.card-list-view {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n.list-row-item {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-md);\n  padding: 12px 18px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  transition: box-shadow 0.15s;\n}\n.list-row-item:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n\n/* 阅读详情页 (Report Detail) */\n.reading-container {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 260px;\n  gap: 40px;\n  align-items: start;\n}\n@media (max-width: 960px) {\n  .reading-container { grid-template-columns: 1fr; }\n  .reading-sidebar { display: none; }\n}\n\n.report-header-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 28px 32px;\n  margin-bottom: 28px;\n}\n.crumb-bar {\n  font-size: 13px;\n  color: var(--geist-tertiary);\n  margin-bottom: 10px;\n}\n.report-title {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  margin: 0 0 16px;\n  color: var(--geist-foreground);\n}\n.report-action-buttons {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 16px;\n  margin-top: 16px;\n}\n\n.article-body {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 36px 42px 80px;\n  font-size: 16px;\n  line-height: 1.75;\n  color: var(--geist-foreground);\n}\n.article-body h1, .article-body h2, .article-body h3 {\n  color: var(--geist-foreground);\n  scroll-margin-top: 80px;\n}\n.article-body h1 { font-size: 28px; font-weight: 600; letter-spacing: -1.28px; border-bottom: 1px solid var(--geist-border); padding-bottom: 8px; margin-top: 32px; }\n.article-body h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.96px; border-bottom: 1px solid var(--geist-border); padding-bottom: 6px; margin-top: 36px; }\n.article-body h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.32px; margin-top: 26px; }\n.article-body table {\n  width: 100%;\n  border-collapse: collapse;\n  margin: 24px 0;\n  font-size: 14px;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  overflow: hidden;\n}\n.article-body th, .article-body td {\n  padding: 10px 14px;\n  text-align: left;\n  border-bottom: 1px solid var(--geist-border);\n}\n.article-body th {\n  background: var(--geist-surface-tint);\n  font-weight: 600;\n  color: var(--geist-foreground);\n}\n.article-body blockquote {\n  border-left: 2px solid var(--geist-foreground);\n  margin: 20px 0;\n  padding: 8px 18px;\n  color: var(--geist-secondary);\n  font-style: normal;\n}\n.article-body code {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13.5px;\n  box-shadow: var(--shadow-ring);\n  background: var(--geist-surface-tint);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n.article-body pre {\n  position: relative;\n  background: #000000;\n  color: #ededed;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 18px;\n  margin: 24px 0;\n  overflow-x: auto;\n}\n.article-body pre code {\n  background: transparent;\n  box-shadow: none;\n  padding: 0;\n  color: inherit;\n  font-size: 13px;\n}\n.copy-code-btn {\n  position: absolute;\n  top: 8px;\n  right: 10px;\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  background: #171717;\n  color: #ffffff;\n  border: 1px solid #333333;\n  padding: 3px 8px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n}\n\n/* 侧边大纲 (TOC) */\n.reading-sidebar {\n  position: sticky;\n  top: 80px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  max-height: calc(100vh - 100px);\n  overflow-y: auto;\n}\n.sidebar-toc-title {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--geist-quaternary);\n  margin-bottom: 12px;\n}\n.reading-sidebar ul {\n  list-style: none;\n  padding-left: 0;\n  margin: 0;\n  font-size: 13px;\n}\n.reading-sidebar li {\n  margin: 6px 0;\n}\n.reading-sidebar ul ul {\n  padding-left: 14px;\n}\n.reading-sidebar a {\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.reading-sidebar a:hover, .reading-sidebar a.active {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 后台管理 (/admin) */\n.admin-card-container {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 32px;\n  margin-bottom: 32px;\n}\n.form-row-2 {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 16px;\n  margin-bottom: 16px;\n}\n@media (max-width: 600px) {\n  .form-row-2 { grid-template-columns: 1fr; }\n}\n.form-field {\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  margin-bottom: 16px;\n}\n.form-field label {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-foreground);\n}\n.form-field input, .form-field select, .form-field textarea {\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  padding: 9px 12px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  color: var(--geist-foreground);\n  outline: none;\n}\n.form-field input:focus, .form-field select:focus, .form-field textarea:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n\n/* 语法高亮 (Console Blue / Purple / Pink) */\n.codehilite .k, .codehilite .kd, .codehilite .kn { color: #eb367f; font-weight: 500; }\n.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #0070f3; }\n.codehilite .nf, .codehilite .na { color: #7928ca; font-weight: 500; }\n.codehilite .c, .codehilite .c1 { color: #666666; font-style: italic; }\n.codehilite .mi, .codehilite .mf { color: #ff5b4f; }\n\n</style>\n\n</head>\n<body>\n\n    <nav class=\"vercel-nav\">\n      <div class=\"nav-brand\">\n        <a href=\"/\" style=\"display:flex;align-items:center;gap:10px;text-decoration:none\">\n          <svg class=\"vercel-triangle\" viewBox=\"0 0 76 65\" fill=\"none\">\n            <path d=\"M37.5274 0L75.0548 65H0L37.5274 0Z\" fill=\"currentColor\"/>\n          </svg>\n          <span class=\"nav-title\">Agent Harness KB</span>\n        </a>\n        <span class=\"nav-badge-pill\">Geist 2.0</span>\n      </div>\n\n      <div class=\"nav-links\">\n        <a class=\"nav-link \" href=\"/\">全景总览</a>\n        <a class=\"nav-link \" href=\"/vad\" style=\"color:var(--ship-red)\">🎯 VAD 专栏 (144)</a>\n        <a class=\"nav-link\" href=\"https://m0rtzz.github.io/paper-notes/\" target=\"_blank\" rel=\"noopener\">顶会 669 篇 ↗</a>\n        <a class=\"nav-link\" href=\"/download/all\">整库打包</a>\n        \n      </div>\n\n      <div class=\"nav-actions\">\n        \n        <button class=\"theme-toggle-btn\" id=\"theme-toggle-btn\" onclick=\"toggleTheme()\" title=\"切换亮暗主题\">🌙</button>\n      </div>\n    </nav>\n    \n<main class=\"vercel-container\">\n\n        <div class=\"report-header-card\">\n          <div class=\"crumb-bar\"><a href=\"/\">Home</a> / <b>fulltext.txt</b></div>\n          <h1 class=\"report-title\">fulltext.txt</h1>\n          <div class=\"report-action-buttons\">\n            <a class=\"btn-primary-dark\" href=\"?dl=1\">Download Text</a>\n          </div>\n        </div>\n        <article class=\"article-body\"><pre><code>Anomaly-Preference Image Generation\n\nFuyun Wang 1 Yuanzhi Wang 1 Xu Guo 2 Sujia Huang 1 Tong Zhang 1 Dan Wang 3 Xin Liu 4 Hui Yan 1\nZhen Cui 2\n\narXiv:2605.02439v4 [cs.CV] 11 Sep 2026\n\nAbstract\n\nReal\nAnomalies\n\nSynthesizing realistic and diverse anomalous samples from limited data is vital for robust model\ngeneralization. However, existing methods struggle to reconcile fidelity and diversity, often hampered by distribution misalignment and overfitting, respectively. To mitigate this, we introduce Anomaly Preference Optimization (APO),\na novel paradigm that reformulates anomaly generation as a preference learning problem. Central to our approach is an implicit preference\nalignment mechanism that leverages real anomalies as positive references, deriving optimization\nsignals directly from denoising trajectory deviations without requiring costly human annotation. Furthermore, we propose a Time-Aware\nCapacity Allocation module that dynamically distributes model capacity along the diffusion timeline—prioritizing structural diversity during highnoise phases while enhancing fine-grained fidelity\nin low-noise stages. During inference, a hierarchical sampling strategy modulates the coherencealignment trade-off, enabling precise control over\ngeneration. Extensive experiments demonstrate\nthat significantly outperforms existing baselines,\nachieving state-of-the-art performance in both realism and diversity.\n\nDualAnoDiff\nCVPR 25\n\nAnomaly\nAny\nCVPR 25\nSeaS\nICCV 25\n\nOurs\nbottle\nbroken_large\n\ntransistor\nbent_lead\n\nscrew\ntoothbrush\ngrid\nscratch_head defective contamination\n\nFigure 1. Compared with state-of-the-art methods including\nAnomalyDiffusion (Hu et al., 2024), DualAnoDiff (Jin et al., 2025),\nAnomalyAny (Sun et al., 2025) and SeaS (Dai et al., 2024), our\napproach have achieved superior performance.\n\nthe model generalization to unseen defects. Recent methods (Sun et al., 2025; Dai et al., 2024) aim to synthesize\nrealistic and diverse anomalies from sparse examples. This\nstrategy effectively bolsters generalization in data-limited\nsettings, offering substantial performance gains in open-set\nand low-resource detection scenarios (Wang et al., 2025).\nEarly anomaly generation relied on hand-crafted heuristics\nsuch as CutPaste (Li et al., 2021) to simulate defects. However, these approaches often yield semantically incoherent\nartifacts and fail to model the structural diversity of real\nanomalies. Leveraging the robust generative priors of diffusion models, recent research has achieved more plausible\nanomaly synthesis (Hu et al., 2024; Dai et al., 2024; Jin\net al., 2025; Sun et al., 2025), primarily classifying into\nfine-tuning-based and training-free paradigms. Fine-tuning\nmethods (Jin et al., 2025; Dai et al., 2024) adapt pre-trained\nmodels on limited data using textual inversion or conditional\nguidance to capture domain-specific patterns. In contrast,\ntraining-free methods (Sun et al., 2025) preserve the original\nparameters and synthesize anomalies solely during inference\nby manipulating attention or feature maps.\n\n1. Introduction\nIndustrial anomaly detection is pivotal to applications ranging from automated visual inspection to medical imaging.\nHowever, the scarcity of anomalous samples coupled with\nthe prohibitive cost of expert annotation severely constrains\n1\n\nNanjing University of Science and Technology, Nanjing, China 2 Beijing Normal University, Beijing, China 3 China\nAcademy of Space Technology, Beijing, China 4 Nanjing SeetaCloud Technology, Nanjing, China.AUTHORERR: Missing\n\\icmlcorrespondingauthor.\nProceedings of the 43 rd International Conference on Machine\nLearning, Seoul, South Korea. PMLR 306, 2026. Copyright 2026\nby the author(s).\n\n1\n\n\fAnomaly-Preference Image Generation\n\nDespite recent progress, balancing realism and diversity remains a persistent challenge. Fine-tuning-based approaches\nare frequently compromised by the decoupled learning of\nappearance and location, which induces semantic incoherence. Simultaneously, the implicit interactions within their\ndual-stream architectures often trigger feature conflicts, degrading structural integrity and leading to training instability due to gradient interference. Conversely, training-free\nmethods shift the computational burden to the inference\nstage, creating a latency bottleneck that restricts their utility in resource-constrained environments. Critically, neither paradigm ensures explicit distributional alignment with\ntarget anomalies. While Direct Preference Optimization\n(Rafailov et al., 2023) offers a theoretical foundation for\nsuch alignment, its reliance on extensive human annotation\nrenders it impractical for data-scarce scenarios. This motivates our core question: How can we formulate a stable\noptimization objective that achieves direct distributional\nalignment via implicit preference learning, deriving supervision signals exclusively from limited anomaly examples?\n\n• Extensive experiments show state-of-the-art performance in anomaly synthesis quality and downstream\ndetection accuracy across multiple benchmarks.\n\n2. Related Work\n2.1. Anomaly Image Generation\nIndustrial anomaly detection suffers from inherent data\nscarcity due to the rarity of defects, motivating the development of anomaly generation techniques. Early model-free\napproaches like Cut-Paste (Li et al., 2021) synthesize anomalies through patch transplantation but produce unrealistic\nartifacts due to limited contextual modeling. GAN-based\nmethods such as DFMGAN (Duan et al., 2023) adapt pretrained models with few anomalies yet struggle with semantic coherence.\nRecent diffusion-based approaches can be categorized into\nfine-tuning and training-free paradigms. Fine-tuning methods like AnomalyDiffusion (Hu et al., 2024) often decouple\nappearance and location learning, resulting in semantically\ninconsistent generations. Dual-stream architectures such\nas DualAnoDiff (Jin et al., 2025) introduce feature conflicts that harm structural integrity, while unified models\nlike SeaS (Dai et al., 2024) face training instability from\ncomplex multi-task optimization. Training-free alternatives\nlike AnomalyAny (Sun et al., 2025) avoid fine-tuning but\nincur substantial inference overhead. These limitations collectively stem from the fundamental distributional misalignment between generated and real anomaly distributions,\nseverely compromising synthesis realism.\n\nIn response, we propose Anomaly Preference Optimization (APO). This unified framework reformulates few-shot\nanomaly generation as a constrained policy optimization\ntask that requires no human annotation. Central to our approach is an implicit preference alignment mechanism. By\nleveraging the latent denoising trajectory deviations of real\nanomalies as intrinsic supervision signals, we enforce strict\ndistributional alignment with target defects while preserving\nthe generative priors of the base model. Furthermore, to\nreconcile the trade-off between diversity and fidelity, we introduce a Time-Aware Capacity Allocation (TACA) strategy.\nThis module dynamically modulates the adaptation capacity\nof the model along the diffusion timeline by limiting updates during high-noise phases to maintain structural diversity while expanding capacity in low-noise stages to capture\nfine-grained patterns. Finally, we implement a Hierarchical\nSampling scheme during inference. This strategy decouples semantic context from defect injection to offer precise\ncontrol over the generation process. Extensive experiments\ndemonstrate that APO not only synthesizes high-fidelity\nanomalies but also yields significant gains in downstream\ndetection performance.\n\n2.2. Reinforcement Learning from Human Feedback\nReinforcement Learning from Human Feedback (RLHF)\nhas become a standard approach for aligning models with human preferences, particularly in language modeling (Christiano et al., 2017; Bai et al., 2022a). The typical RLHF\npipeline first trains a reward model on human-annotated\npreference pairs, then fine-tunes the base model using reinforcement learning objectives like PPO (Lee et al., 2023).\nHowever, this two-stage process faces computational overhead and training instability. Direct Preference Optimization (DPO) (Rafailov et al., 2023) addresses these issues\nby directly optimizing policies through a closed-form preference loss, eliminating explicit reward modeling. This\nstable framework has inspired extensions including SLiCHF (Zhao et al., 2023) and ORPO (Hong et al., 2024) for\nimproved preference alignment.\n\nIn summary, our contributions are three-fold:\n• We propose APO, a novel framework for few-shot\nanomaly generation that leverages implicit preference\nalignment to eliminate explicit reward modeling or\nreinforcement learning.\n\nIn computer vision, preference alignment has been increasingly applied to diffusion models for visual quality enhancement (Fan et al., 2023). Existing approaches either extend\nPPO-based RLHF to image generation or adapt DPO using human-ranked images (Wallace et al., 2024). However,\n\n• We design a time-aware capacity allocation and a hierarchical sampling strategy, which collectively balance\nstructural diversity and fine-grained fidelity across the\ndiffusion trajectory.\n2\n\n\fAnomaly-Preference Image Generation\n\nthese methods remain dependent on costly human annotations and primarily target general quality improvement.\nOur work extends DPO to few-shot anomaly generation\nby replacing human-annotated preferences with implicit\nalignment signals from real anomaly samples, eliminating\nannotation requirements while enabling domain-specific distribution alignment.\n\nThe DPO objective which optimizes the policy is defined:\n\n3. Preminilaries\n\nWhile DPO provides a principled route to preference alignment, the absence of preference pairs in few-shot anomaly\nsynthesis leads us to adopt a reparameterized objective that\nbypasses explicit reward learning and RL, directly optimizing a KL-regularized conditional policy pθ (z0 | c) using an\nimplicitly defined consistency reward R(z0 , c).\n\n  &amp;\\mathcal {L}_{\\text {DPO}} = -\\mathbb {E}_{\\c ,\\z ^w_0,\\z ^l_0} \\nonumber \\\\ &amp;\\left [ \\log \\sigm \\left ( \\beta \\log \\frac {p_\\theta (\\z ^w_0|\\mathbf {c})}{p_\\text {ref}(\\z ^w_0|\\mathbf {c})} - \\beta \\log \\frac {p_\\theta (\\z ^l_0|\\mathbf {c})}{p_\\text {ref}(\\z ^l_0|\\mathbf {c})} \\right ) \\right ].\n\n(6)\n\nStable Diffusion. We adopt the latent-space diffusion formulation of Stable Diffusion (Rombach et al., 2022). Given\nan image x, an encoder E maps it to a latent z0 = E(x); with\na text condition embedding c, the forward noising process\nis zt = αt z0 + σt ϵ, where t ∼ U (0, T ), ϵ ∼ N (0, I), and\nαt , σt is a noise schedule (αt2 + σt2 = 1). λt = log(αt2 /σt2 )\ndenotes the log signal-to-noise ratio (log-SNR) at time t and\nλ′t denotes the time-derivative of λt . A denoising network\nϵθ is trained to predict the injected noise in latent space\nusing:\n  \\mathcal {L}_{\\mathrm {SD}}=\\mathbb {E}_{\\z _0,\\c ,t,\\boldsymbol {\\epsilon }}\\left [\\|\\boldsymbol {\\epsilon }-\\epsilon _\\theta (\\z _t,\\mathbf {c},t)\\|_2^2\\right ]. \\label {eq:1} \n\n4. Method\n4.1. Problem Definition\nIn the few-shot anomaly generation settings, we are provided with a limited reference set \\protect \\mathcal  {D}_{\\text {ref}} = \\{(\\mathbf {z}_{i,0}, \\mathbf {c}_i)\\}_{i=1}^K ,\nwhere \\protect \\mathbf  {z}_{i,0} = \\mathcal {E}(\\mathbf {x}_i) is the latent representation of an\nanomaly sample \\protect \\mathbf  {x}_i with textual condition \\protect \\mathbf  {c}_i , subscript i denotes the sample index and 0 denotes the diffusion timestep.\nLet p_\\text {ref}(\\z _{i,0} | \\c _i) denote reference distribution induced by\na pretrained latent diffusion model. Our goal is to learn a\nanomaly-aligned generation policy p_\\theta (\\mathbf {z}_{i,0} | \\c _i) that synthesizes novel, high-fidelity anomaly samples consistent with\nthe underlying structure and anomaly patterns in \\protect \\mathcal  {D}_{\\text {ref}} , while\nretaining the general generative capability and diversity.\n\n(1)\n\nDirect Preference Optimization. In preference-based\nlearning we assume access to condition-labeled comparison\npairs (\\z ^w_0, \\z ^l_0) \\sim \\mathcal {D}_z for a conditioning \\protect \\mathbf  {c}, with \\mathbf {z}^w_0 \\succ \\z ^l_0 | \\c \nindicating that \\mathbf {z}^w_0 is preferred over \\mathbf {z}^l_0 . The Bradley-Terry\nmodel (Bradley &amp; Terry, 1952) formulates the probability\nof preference as:\n  p_\\text {BT}(\\z ^w_0 \\succ \\z ^l_0 | \\c ) = \\sigm \\left (\\mathcal {R}(\\z ^w_0, \\c ) - \\mathcal {R}(\\z ^l_0, \\c )\\right ),  (2)\n\nOur abstract idea formulates few-shot anomaly generation\nas a constrained policy optimization problem, where we\naim to learn a generative policy p_\\theta (\\mathbf {z}_{0} | \\mathbf {c}) that maximizes\nalignment with target anomaly patterns while maintaining\nproximity to the reference distribution. Formally, we seek\nto optimize:\n\nwhere \\protect \\sigm  (\\cdot ) is the sigmoid function and \\protect \\mathcal  {R}(\\cdot ) represents an implicit reward function measuring sample quality. The reinforcement learning from human feedback\n(RLHF) (Bai et al., 2022b) framework aims to optimize\na policy p_\\theta (\\z _0|\\mathbf {c}) to maximize expected reward while regularizing against a reference model p_\\text {ref}(\\z _0|\\c ):\n\n  \\max _\\theta &amp; \\quad \\mathbb {E}_{\\mathbf {c} \\sim \\mathcal {D}_\\text {ref}, \\mathbf {z}_{0} \\sim p_\\theta (\\mathbf {z}_{0} | \\mathbf {c})}[\\mathcal {R}(\\mathbf {z}_{0}, \\mathbf {c})], \\\\ \\text {s.t.} &amp; \\quad \\mathbb {E}_{\\mathbf {c} \\sim \\mathcal {D}_\\text {ref}}[D_{\\text {KL}}(p_\\theta (\\mathbf {z}_{0} | \\mathbf {c}) \\| p_{\\text {ref}}(\\mathbf {z}_{0} | \\mathbf {c}))] \\leq \\boldsymbol {\\epsilon },\n\n  &amp;\\max _{p_\\theta } \\mathbb {E}_{\\c \\sim \\mathcal {D}_c, \\z _0 \\sim p_\\theta (\\z _0|\\c )} [\\mathcal {R}(\\z _0,\\c )] \\nonumber \\\\ &amp;- \\beta \\mathbb {D}_{\\text {KL}} \\left [ p_\\theta (\\z _0|\\c ) \\| p_\\text {ref}(\\z _0|\\c ) \\right ], \\label {eq:3}\n\n(8)\n(3)\n\nwhere \\protect \\mathcal  {R}(\\mathbf {z}_{0}, \\mathbf {c}) is an implicit reward function quantifying\nanomaly alignment, and \\epsilon &gt; 0 defines the maximum allowable distributional shift to preserve generation stability.\nFor tractable optimization, we employ the Lagrangian dual\nformulation, which yields the practical objective:\n\nwhere \\beta  controls the regularization strength.\nDirect Preference Optimization (DPO) (Rafailov et al.,\n2023) provides an elegant solution to solve Eqn. (3) by\nderiving the optimal policy form as follows:\n \\label {eq4} p_\\theta ^*(\\z _0|\\c ) = \\frac {1}{Z(\\c )} p_\\text {ref}(\\z _0|\\c ) \\exp \\left (\\frac {\\mathcal {R}(\\z _0,\\c )}{\\beta }\\right ), \n\n  &amp;\\max _\\theta \\mathbb {E}_{\\mathbf {c} \\sim \\mathcal {D}_\\text {ref}, \\mathbf {z}_{0} \\sim p_\\theta (\\mathbf {z}_{0} | \\mathbf {c})}[\\mathcal {R}(\\mathbf {z}_{0}, \\mathbf {c})] \\nonumber \\\\ &amp;- \\beta \\cdot \\mathbb {E}_{\\mathbf {c} \\sim \\mathcal {D}_\\text {ref}}[D_{\\text {KL}}(p_\\theta (\\mathbf {z}_{0} | \\mathbf {c}) \\| p_{\\text {ref}}(\\mathbf {z}_{0} | \\mathbf {c}))],\n\n(4)\n\n(9)\n\nP\nwhere Z(c) = z0 pref (z0 |c) exp(R(z0 , c)/β) is the partition function. This leads to the key reparameterization:\n\nwith \\beta &gt; 0 serving as the regularization coefficient that\nexplicitly controls the trade-off between anomaly alignment\nand distributional conservation. This formulation maintains\ntheoretical rigor while enabling efficient optimization, as\ndetailed in Algorithm 1.\n\n  \\mathcal {R}(\\z _0,\\mathbf {c}) = \\beta \\log \\frac {p_\\theta ^*(\\z _0|\\mathbf {c})}{p_\\text {ref}(\\z _0|\\mathbf {c})} + \\beta \\log Z(\\mathbf {c}). \n\n(5)\n3\n\n\fAnomaly-Preference Image Generation\n\nAlgorithm 1 APO: Anomaly Preference Optimization\n\nFormally, for a diffusion trajectory \\protect \\mathbf  {z}_{i,0:T} , we derive a\ntractable deviation function:\n\nRequire: Base diffusion model ϵref , few-shot anomaly samples {(xi , ci )}, regularization coefficient β\nEnsure: Optimized anomaly generation policy ϵθ with\nTACA mechanism\n1: Initialize policy network ϵθ with time-aware LoRA\nadaptation\n2: while not converged do\n3:\nStep 1: Sample training instance\n4:\nSample real anomaly (xi , ci ) ∼ Dref , timestep t ∼\nU(0, T ), noise ϵ ∼ N (0, I)\n5:\nCompute noisy latent: zt = αt E(xi ) + σt ϵ\n6:\nStep 2: Estimate implicit reward via denoising\ndeviation\n7:\nCompute reference denoising: ϵ̂ref = ϵref (zt , ci , t)\n8:\nCompute policy denoising: ϵ̂θ = ϵθ (zt , ci , t)\n9:\nCalculate alignment deviation: ∆ = ∥ϵ̂θ − ϵ∥22 −\n∥ϵ̂ref − ϵ∥22 {∆ &lt; 0 indicates superior policy alignment}\n10:\nStep 3: Optimize constrained objective\n11:\nCompute time-adaptive weight: βt = − 12 βλ′t\n12:\nOptimize implicit preference objective: LAPO =\n− log σ (−βt ∆) {Maximizes R while enforcing KL\nconstraint via β}\n13: end while\n\n  \\delta (p_\\theta , p_\\text {ref}; \\x _i,\\c _i) &amp;= D_{\\text {KL}}(q(\\z _{i,0:T}|\\x _i) \\| p_\\text {ref}(\\z _{i,0:T}|\\c _i)) \\nonumber \\\\ &amp;- D_{\\text {KL}}(q(\\z _{i,0:T}|\\x _i) \\| p_\\theta (\\z _{i,0:T}|\\c _i)). \\label {eq:9}\n(12)\nwhere a positive δ &gt; 0 signifies stronger alignment with the\ntarget patterns, a property essential for preserving realism\nin few-shot anomaly generation. Via variational inference,\nwe establish the following relation between the expected\nreward and the deviation function:\n  \\mathbb {E}_{q(\\mathbf {z}_{i,0:T}|\\mathbf {x}_i)}[\\mathcal {R}(\\mathbf {z}_{i,0:T},\\mathbf {c}_i)] = \\beta \\cdot \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x}_i,\\mathbf {c}_i) + C, \n(13)\nwhere C = β log Z(ci ) is a constant independent of xi .\nThis result certifies that maximizing the deviation δ directly\ncorresponds to maximizing the expected implicit reward,\nthereby enhancing generation realism. However, computing\nthe exact deviation δ in Eqn. (12) requires evaluating likelihoods over the entire diffusion trajectory zi,0:T , which is\ncomputationally intractable.\nTo this end, we factorize the ELBO to obtain a tractable\nsurrogate objective and, under the noise-prediction parameterization in Eqn. (1), derive a closed-form latent-space\ndeviation function:\n  &amp;\\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x}_i,\\mathbf {c}_i) = \\frac {1}{2} \\mathbb {E}_{t \\sim \\mathcal {U}(0,T), \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(0,\\mathbf {I})} \\nonumber \\\\ &amp;\\left [ \\lambda ^\\prime _t \\left ( \\|\\epsilon _\\theta (\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\boldsymbol {\\epsilon }\\|_2^2 \\right ) \\right ], \\label {eq:12}\n\n4.2. Constrained Policy Optimization\nWhile the direct preference optimization (DPO) framework\nprovides a solid theoretical foundation, its direct application\nto few-shot anomaly synthesis faces a critical limitation:\ntraditional DPO requires expensive human-annotated preference pairs where both positive and negative samples are\ngenerated by the model. In contrast, we propose Constrained\nPolicy Optimization (CPO) which bypasses human annotation by leveraging real anomalies as positives and deriving\nimplicit negative examples from denoising trajectory deviations. Our key insight stems from the optimal policy form\nderived from the constrained objective Eqn. (4):\n\n(14)\nThis formulation allows efficient Monte Carlo estimation\nduring training by sampling random timesteps  t  and noise\nvectors  \\boldsymbol {\\epsilon } . Substituting the tractable deviation expression\nEqn. (14) into the reward reparameterization Eqn. (12), and\napplying the log-Sigmoid transformation to stabilize optimization, we derive our final anomaly-aligned objective:\n  \\mathcal {L}_{\\text {APO}} = &amp;\\mathbb {E}_{\\,t \\sim \\mathcal {U}(0,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\Bigl [ -\\log \\sigm \\nonumber \\\\ &amp;\\Bigl ( -\\beta _t \\bigl ( \\|\\epsilon _\\theta (\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\boldsymbol {\\epsilon }\\|_2^2 \\nonumber \\\\ &amp;- \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\boldsymbol {\\epsilon }\\|_2^2 \\bigr ) \\Bigr ) \\Bigr ], \\label {eq:13}\n\n  p_\\theta ^*(\\mathbf {z}_{i,0:T}|\\mathbf {c}_i) \\propto p_\\text {ref}(\\mathbf {z}_{i,0:T}|\\mathbf {c}_i) \\exp (\\mathcal {R}(\\mathbf {z}_{i,0:T},\\mathbf {c}_i)/\\beta ), \n(10)\nwhich reveals that the optimal policy is a reward-weighted\nversion of the base model. Rearranging terms yields the\npivotal reparameterization:\n\n(15)\nwhere  \\beta _t = -\\frac {1}{2} \\beta \\lambda ^\\prime _t  . LAPO provides a practical implementation that directly optimizes the implicit consistency reward\nwhile regularizing against the base model through the implicit KL divergence constraint, ensuring stable optimization\nwithout explicit negative examples.\n\n  \\mathcal {R}(\\mathbf {z}_{i,0:T},\\mathbf {c}_i) = \\beta \\log \\frac {p_\\theta ^*(\\mathbf {z}_{i,0:T}|\\mathbf {c}_i)}{p_\\text {ref}(\\mathbf {z}_{i,0:T}|\\mathbf {c}_i)} + \\beta \\log Z(\\mathbf {c}_i), \\label {eq:9}  (11)\nwhere Z(ci ) is the partition function. We introduce an\nimplicit comparison mechanism that evaluates the relative\ndenoising quality between the current policy and the reference model on shared real anomalies. This constructs a crucial preference signal: superior denoising directly indicates\nstronger alignment with the target anomaly distribution.\n\n4.3. Time-Aware Capacity Allocation\nWhile our constrained policy optimization successfully enhances anomaly fidelity, it inadvertently suppresses generation diversity. The uniform fine-tuning inherent in this\n4\n\n\fAnomaly-Preference Image Generation\n\nprocess causes high-noise steps—responsible for structural\nlayout—to overfit to background patterns, thereby limiting\nthe model’s capacity for structural variation. To mitigate\nthis, we propose Time-Aware Capacity Allocation (TACA),\nwhich schedules the LoRA rank to be minimal at high-noise\nsteps to preserve structural diversity, and maximal at lownoise steps to enhance fine-grained fidelity. Specifically, we\nimplement time-aware capacity allocation through a temporal gating mechanism for low-rank adaptations. The weight\nupdate at each timestep is formulated as ∆Wt = B · Gt · A,\nwhere the temporal gate Gt modulates parameter influence\nthrough a dimension-selection mask:\n  G_t = \\text {diag}(\\underbrace {1,\\ldots ,1}_{k(t)},\\underbrace {0,\\ldots ,0}_{r-k(t)}), \n\nprovides anomaly-sensitive signals, but requires careful\nmapping to pixel space for accurate localization. We address\nthis through a multi-scale aggregation strategy:\n  \\mathbf {M} = \\frac {1}{T}\\sum _{t=1}^T k(t) \\cdot \\text {Upsample}\\left (\\|\\Delta _{\\text {align}}(\\mathbf {z}_t)\\|_2\\right ), \n\n(19)\n\nwhere Upsample(·) denotes bilinear upsampling to match\nthe spatial dimensions of the original image, and k(t) follows the TACA expansion schedule. This direct spatial\nmapping preserves the relative anomaly strength while maintaining computational efficiency.\nTo enhance localization precision, we leverage the structural\nconsistency between latent and pixel spaces:\n\n(16)\n\n  \\mathbf {P}_{\\text {anomaly}} = \\text {Smooth}\\left (\\frac {\\mathbf {M} - \\min (\\mathbf {M})}{\\max (\\mathbf {M}) - \\min (\\mathbf {M}) }\\right ), \n\nwith the active dimension count k(t) following an expansion\nschedule k(t) = ⌊kmin + (kmax − kmin ) · (T − t)/T ⌋. This\nensures minimal adaptation at high-noise steps (t → T ) to\npreserve structural diversity, while progressively engaging\nmore parameters at low-noise steps (t → 0) to enhance\nfine-grained anomaly synthesis.\n\n(20)\n\nwhere Smooth(·) applies a fixed 3 × 3 Gaussian filter to\nreduce artifacts from the upsampling process while preserving anomaly boundaries. The resulting probability map\ndirectly reflects anomaly likelihood at pixel level without\nintroducing domain-specific assumptions.\n\n4.4. Hierarchical Sampling Strategy\n\nThe complete derivation of the relevant formulas mentioned\nabove is included in the appendix.\n\nDuring inference, we introduce a hierarchical guidance sampling strategy to enable precise control over the trade-off\nbetween base model coherence and anomaly pattern consistency. This approach addresses the challenge of balancing\nthe general generative capability of the reference model with\nthe specific alignment to anomaly characteristics learned\nfrom few-shot examples.\n\n5. Experiment\n5.1. Datasets\nOur experiments are conducted on the MVTec benchmark (Bergmann et al., 2019), which contains 5,354 highresolution images from 15 industrial categories (10 objects\nand 5 textures). Following the standard split, the dataset\nincludes 3,629 normal images for training and 1,725 test\nimages containing both normal and anomalous samples.\nFollowing AnomalyDiffusion (Hu et al., 2024), we use 1/3\nof anomalies per category as reference set, reserving the\nremaining 2/3 for evaluation.\n\nThe key insight is that the denoising process can be decomposed into three complementary components: the unconditional generation prior, text-conditioned semantic guidance,\nand anomaly-specific pattern injection. Formally, the denoising process is structured as:\n  \\hat {\\epsilon }(\\mathbf {z}_{i,t};\\mathbf {c}_i,t) = \\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t},t) + s_{\\text {text}} \\cdot \\Delta _{\\text {text}} + s_{\\text {align}} \\cdot \\Delta _{\\text {align}},  (17)\nwhere \\Delta _{\\text {text}} = \\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t},t) governs the textconditioning strength to maintain semantic consistency,\nand \\Delta _{\\text {align}} = \\epsilon _\\theta (\\mathbf {z}_{i,t};\\mathbf {c}_i,t) - \\epsilon _{\\text {ref}}(\\mathbf {z}_{i,t};\\mathbf {c}_i,t) regulates the\nanomaly pattern alignment strength to enhance few-shot\nadaptation. This formulation is mathematically equivalent\nto sampling from a guided distribution:\n\n5.2. Evaluation Metrics\nFor generation assessment, we employ Inception Score (IS)\nto evaluate sample fidelity and Intra-cluster pairwise LPIPS\ndistance (IC-LPIPS) to measure diversity; for anomaly inspection, we report AUROC, Average Precision (AP), and\nF1-max scores to quantify detection and localization accuracy across image and pixel levels.\n\n  &amp;p_{\\text {guided}}(\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t}) \\propto p_{\\text {ref}}(\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t}) \\cdot \\nonumber \\\\ &amp;\\left ( \\frac {p_{\\text {ref}}(\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t},\\mathbf {c}_i)}{p_{\\text {ref}}(\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t})} \\right )^{s_{\\text {text}}} \\cdot \\left ( \\frac {p_\\theta (\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t},\\mathbf {c}_i)}{p_{\\text {ref}}(\\mathbf {z}_{i,t-1}|\\mathbf {z}_{i,t},\\mathbf {c}_i)} \\right )^{s_{\\text {align}}}.\n\n5.3. Implementation Details\n(18)\n\nWe initialize APO with the pre-trained weights from Stable Diffusion v1-4 (Rombach et al., 2022). We employ\nLoRA fine-tuning with TACA, setting the rank bounds to\nk_{\\min } = 4 and k_{\\max } = 32. The model is optimized using\n\nDeviation-Guided Anomaly Localization. The alignment\ndeviation ∆align = ϵθ (zt ; c, t) − ϵref (zt ; c, t) in latent space\n5\n\n\fAnomaly-Preference Image Generation\nTable 1. Quantitative comparison of IS and IC-LPIPS on MVTec. Our method achieves the best scores in both metrics. Bold and\nunderlined values indicate the top and second-best results, respectively. AnomalyDiff: AnomalyDiffusion.\nCategory\n\nCrop&amp;Paste\nIS ↑ IC-L ↑\n\nDFMGAN\nIS ↑ IC-L ↑\n\nAnomalyDiff\nIS ↑ IC-L ↑\n\nDualAnoDiff\nIS ↑ IC-L↑\n\nAnomalyAny\nIS ↑ IC-L ↑\n\nIS ↑\n\nSeaS\nIC-L ↑\n\nIS ↑\n\nOurs\nIC-L ↑\n\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntoothbrush\ntransistor\nwood\nzipper\n\n1.43\n1.74\n1.23\n1.17\n2.00\n1.74\n1.47\n1.56\n1.49\n1.12\n1.83\n1.30\n1.39\n1.95\n1.23\n\n0.04\n0.25\n0.05\n0.11\n0.12\n0.21\n0.14\n0.15\n0.11\n0.16\n0.20\n0.08\n0.15\n0.23\n0.11\n\n1.62\n1.96\n1.59\n1.23\n1.97\n1.93\n2.06\n1.49\n1.63\n1.12\n2.39\n1.82\n1.64\n2.12\n1.29\n\n0.12\n0.25\n0.11\n0.13\n0.13\n0.24\n0.17\n0.32\n0.16\n0.14\n0.22\n0.18\n0.25\n0.35\n0.27\n\n1.58\n2.13\n1.59\n1.16\n2.04\n2.13\n1.94\n1.96\n1.61\n1.28\n2.54\n1.68\n1.57\n2.33\n1.39\n\n0.19\n0.41\n0.21\n0.24\n0.44\n0.31\n0.41\n0.30\n0.26\n0.30\n0.55\n0.21\n0.34\n0.37\n0.25\n\n2.17\n2.15\n1.62\n1.36\n2.13\n1.94\n1.91\n1.57\n1.82\n1.43\n2.40\n2.40\n1.71\n2.24\n2.14\n\n0.43\n0.43\n0.32\n0.29\n0.42\n0.35\n0.35\n0.32\n0.38\n0.36\n0.50\n0.48\n0.33\n0.40\n0.37\n\n1.73\n2.06\n2.16\n1.10\n2.31\n2.55\n2.26\n1.82\n2.91\n1.33\n2.66\n1.64\n1.66\n1.93\n2.14\n\n0.17\n0.41\n0.23\n0.34\n0.38\n0.32\n0.41\n0.27\n0.30\n0.32\n0.53\n0.22\n0.28\n0.41\n0.33\n\n1.78\n2.09\n1.56\n1.13\n2.43\n1.87\n2.03\n1.64\n1.62\n1.52\n2.60\n1.96\n1.51\n2.77\n1.63\n\n0.21\n0.42\n0.26\n0.25\n0.44\n0.31\n0.40\n0.31\n0.33\n0.31\n0.50\n0.25\n0.34\n0.46\n0.30\n\n2.19\n2.20\n2.18\n1.39\n2.44\n2.07\n2.28\n1.99\n2.55\n1.53\n2.68\n2.45\n1.77\n2.32\n2.16\n\n0.45\n0.45\n0.34\n0.36\n0.46\n0.37\n0.42\n0.36\n0.40\n0.38\n0.54\n0.49\n0.36\n0.44\n0.39\n\naverage\n\n1.54\n\n0.14\n\n1.72\n\n0.20\n\n1.80\n\n0.32\n\n1.93\n\n0.38\n\n2.02\n\n0.33\n\n1.88\n\n0.34\n\n2.14\n\n0.41\n\n5.4. Anomaly Generation Quality Comparison\n\nAdam (Kingma, 2014) with a learning rate of 5 \\times 10^{-5} and\nbatch size 1. For inference, we use the DDIM (Song et al.,\n2020) scheduler with 100 sampling steps and set the guidance scale stext = 6.5 and salign = 3 . All experiments are\nconducted on NVIDIA GeForce RTX 4090 48G GPUs. In\nthe following experiments, we generate 1,000 image-mask\npairs per category to evaluate both generation quality and\ndownstream inspection performance.\n\nBaselines. We evaluate our model against several established methods, namely Crop&amp;Paste (Lin et al., 2021),\nDFMGAN (Duan et al., 2023), AnomalyDiff (Hu et al.,\n2024), DualAnoDiff (Jin et al., 2025), AnomalyAny (Sun\net al., 2025), and SeaS (Dai et al., 2024).\nAnomaly Generation Quality. Fig. 2 qualitatively demonstrates our method’s superiority in generating faithful and\nsemantically coherent anomalies. For structural defects\nlike capsule–squeeze and transistor (cut lead), where baselines often preserve original shapes or produce blur artifacts, our approach yields localized deformations that align\nwith mask regions while preserving overall structure. For\nhazelnut–crack, baseline methods often over-distort the entire nut into implausible shapes, whereas our model preserves the global structure and only introduces a localized,\nmask-aligned crack. Similar structural artifacts appear in\nmetal nut (color) and cable (bent wire), where competing\napproaches cause global color or geometry drifts, while our\nmodel yields realistic anomaly images.\n\nMVTec\n\nAnomaly\nDiffusion\nAAAI 24\nDualAno\nDiff\nCVPR 25\nAnomaly\nAny\nCVPR 25\n\nAs shown in Tab. 1, our our APO achieves state-of-the-art\nperformance, improving average IS by 5.9% and IC-LPIPS\nby 7.9% over the strongest baseline. The most significant\ngains are observed in categories requiring precise structural control—such as zipper, cable, and bottle—where our\nmethod achieves superior realism while maintaining diversity. For texture-oriented categories like carpet and leather,\nwe obtain balanced improvements in both metrics, demonstrating effective pattern preservation during anomaly synthesis. These results demonstrate our method’s effectiveness\nin balancing realism and diversity.\nAnomaly Generation for Anomaly Detection and Localization. Following established benchmarks, we compare\n\nSeaS\nICCV 25\n\nOurs\ncapsule\nsqueeze\n\nhazelnut\ncrack\n\nmetal_nut\ncolor\n\ncable\nbent_wire\n\ntransistor\ncut_lead\n\nFigure 2. Comparative analysis on the MVTec dataset demonstrates our model’s capability in generating high-quality anomaly\nimages that faithfully reflect the provided masks.\n\n6\n\n\fAnomaly-Preference Image Generation\nTable 2. Anomaly Detection Performance on MVTec AD. We compare the results of training a U-Net on synthetic data from DFMGAN,\nAnomalyDiffusion, DulAnoDiff, SeaS and our model for both pixel-level localization and image-level detection.\n\nDFMGAN\n\nCategory\n\nAnomalyDiffusion\n\nDualAnoDiff\n\nSeaS\n\nOurs\n\nAUC-P AP-P F1 -P AP-I AUC-P AP-P F1 -P AP-I AUC-P AP-P F1 -P AP-I AUC-P AP-P F1 -P AP-I AUC-P AP-P F1 -P AP-I\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntoothbrush\ntransistor\nwood\nzipper\n\n98.9\n97.2\n79.2\n90.6\n75.2\n99.7\n98.5\n99.3\n81.2\n58.8\n99.5\n96.4\n96.2\n95.3\n92.9\n\n90.2 83.9 99.8\n81.0 75.4 97.8\n26.0 35.0 98.5\n33.4 38.1 98.5\n14.3 20.5 90.4\n95.2 89.5 100\n68.7 66.7 100\n98.1 94.5 99.8\n67.8 72.6 91.7\n2.2 5.3 64.7\n97.1 91.6 100\n75.9 72.6 100\n81.2 77.0 92.5\n70.7 65.8 99.4\n65.6 64.9 99.9\n\n99.4\n99.2\n98.8\n98.6\n98.3\n99.8\n99.8\n99.8\n99.8\n97.0\n99.2\n99.2\n99.3\n99.8\n99.4\n\nAverage\n\n90.0\n\n62.7 62.1 94.8 99.1\n\n94.1 87.3 99.9\n90.8 83.5 100\n57.2 59.8 99.9\n81.2 74.6 98.8\n52.9 54.6 99.5\n96.5 90.6 99.9\n79.6 71.0 100\n98.7 94.0 100\n97.0 90.8 99.6\n51.8 50.9 97.9\n93.9 86.2 100\n76.5 73.4 100\n92.6 85.7 100\n84.6 74.5 99.4\n86.0 79.2 100\n\n99.5\n97.5\n99.5\n99.4\n98.5\n99.8\n99.9\n99.6\n99.6\n98.1\n99.7\n98.2\n98.0\n99.4\n99.6\n\n81.4 76.3 99.7 99.1\n\nTable 3. Anomaly Classification Accuracy (%) with ResNet34 on Generated Data. AnoDiff: AnomalyDiffusion, DualAno:DualAnoDiff\n\n56.59\n45.31\n37.23\n47.31\n40.83\n81.94\n49.73\n64.58\n29.52\n37.45\n74.85\n52.38\n49.21\n27.64\n\n88.37\n76.56\n44.00\n58.06\n60.00\n81.25\n65.08\n82.81\n64.58\n29.63\n92.98\n75.00\n78.57\n86.59\n\n67.44\n57.81\n50.67\n62.90\n67.50\n79.17\n84.13\n73.44\n41.67\n39.51\n100\n78.57\n90.48\n24.39\n\n81.40 84.63\n48.44 73.37\n33.33 50.87\n38.71 63.35\n47.50 64.54\n81.25 80.68\n61.90 71.50\n68.75 78.48\n18.75 65.72\n56.79 58.95\n89.47 100\n57.14 80.69\n76.19 68.32\n34.15 67.74\n\nAverage\n\n49.61\n\n70.25\n\n65.55\n\n56.70 72.06\n\n99.7\n96.0\n93.7\n99.3\n99.7\n99.5\n99.8\n99.8\n99.9\n98.5\n99.8\n98.4\n98.0\n99.0\n99.7\n\n84.5 78.8 98.9 98.7\n\n95.9 88.8 99.9\n83.1 77.7 98.8\n41.9 47.3 99.2\n86.4 78.1 99.0\n76.3 70.0 99.9\n92.3 85.6 99.8\n85.2 77.0 100\n99.2 95.7 100\n97.1 90.7 99.6\n58.5 57.2 98.0\n97.9 92.5 100\n70.0 68.1 100\n87.3 81.9 99.5\n87.0 79.6 99.6\n88.2 81.6 100\n\n99.6\n98.9\n99.7\n99.8\n99.0\n99.9\n99.9\n99.8\n99.9\n98.8\n99.8\n99.5\n99.6\n99.9\n99.6\n\n96.5 88.2 100\n85.3 79.2 98.5\n75.6 69.0 99.4\n92.1 82.5 100\n60.1 57.2 99.8\n98.5 94.0 100\n91.7 81.1 100\n100 95.7 100\n97.5 92.0 99.8\n59.5 57.7 95.7\n99.3 93.7 100\n77.8 74.6 100\n93.8 87.0 100\n94.7 76.8 100\n93.7 85.1 100\n\n83.1 78.1 99.6 99.6\n\n87.7 80.9 99.5\n\non challenging categories such as screw, capsule, and carpet, further validating the method’s capability in generating\nstructurally complex and subtle anomalies.\nAnomaly Generation for Anomaly Classification. We\nfurther evaluate the semantic discriminability of generated\nanomalies through classification tasks using a ResNet-34\nbackbone. As summarized in Tab. 3, our method achieves\nthe highest average classification accuracy of 72.06%, outperforming all compared generation approaches. The performance advantage is particularly pronounced in challenging\ncategories like metal nut and pill. Notably, in texture-rich\ncategories including leather and tile, our method achieves\nnear-perfect accuracy, indicating its effectiveness in maintaining both structural integrity and semantic consistency\nduring anomaly synthesis.\n\nCategory DFMGAN AnoDiff DualAno SeaS Ours\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntransistor\nwood\nzipper\n\n93.4 85.7 100\n82.6 76.9 98.3\n73.2 67.0 99.2\n89.1 80.2 99.9\n57.2 54.9 99.7\n97.7 92.8 100\n88.8 78.8 100\n98.0 93.0 99.9\n95.8 89.2 99.0\n57.1 56.1 95.0\n97.1 91.0 100\n68.3 68.6 99.7\n86.7 79.6 99.7\n91.6 83.8 99.9\n90.7 82.7 100\n\n5.5. Comparison with Anomaly Detection Models\nWe compare our method with state-of-the-art anomaly detection approaches under both unsupervised and supervised\nsettings. The unsupervised baselines include DRAEM (Zavrtanik &amp; Kristan, 2021), SSPCAB (Ristea et al., 2022),\nCFA (Lee et al., 2022), RD4AD (Deng &amp; Li, 2022), PatchCore (Roth et al., 2022), and MuSc (Li et al., 2024), while\nthe supervised baselines include DevNet (Pang et al., 2021),\nDRA (Ding et al., 2022), and PRN (Zhang et al., 2023).\nWe use official implementations or pre-trained models for\nthe baselines, except PRN, whose results are taken from\nthe original paper. As shown in Tab. 4, a standard U-Net\ntrained on our generated anomalies achieves an average\npixel-level AUROC of 99.6% and AP of 87.7%, outperforming all compared methods on MVTec AD. Compared\n\nagainst DFMGAN, AnomalyDiffusion, and DualAnoDiff\nusing results reported in their original papers, while AnomalyAny and SeaS are evaluated using official implementations or pre-trained models. As demonstrated in Table 2,\nthe U-Net model trained on the anomalies generated by our\nmethod achieves state-of-the-art performance, attaining the\nhighest AUC-P of 99.6% and an F1-max score of 80.9%. Besides, our approach also achieves competitive results across\nother metrics, including 87.7% AP-P and 99.5% AP-I at\nthe image level. Notable performance gains are observed\n7\n\n\fAnomaly-Preference Image Generation\nTable 4. Quantitative Comparison of Anomaly Localization Performance (AUROC/AP). We evaluate a standard U-Net trained on our\ngenerated anomalies against existing detection methods using official implementations or pre-trained models.\nUnsupervised\n\nCategory\n\nSupervised\n\nDRAEM\n\nSSPCAB\n\nCFA\n\nRD4AD\n\nPatchCore\n\nMusc\n\nDevNet\n\nDRA\n\nPRN\n\nOurs\n\nbottle\ncable\ncapsule\ncarpet\ngrid\nhazelnut\nleather\nmetal nut\npill\nscrew\ntile\ntoothbrush\ntransistor\nwood\nzipper\n\n99.1/88.5\n94.8/61.4\n97.6/47.9\n96.3/62.5\n99.5/53.2\n99.5/88.1\n98.8/68.5\n98.7/91.6\n97.7/44.8\n99.7/72.9\n99.4/96.4\n97.3/49.2\n92.2/56.0\n97.6/81.6\n98.6/73.6\n\n98.9/88.6\n93.1/52.1\n90.4/48.7\n92.3/49.1\n99.6/58.2\n99.6/94.5\n97.2/60.3\n99.3/95.1\n96.5/48.1\n99.1/62.0\n99.2/96.3\n97.5/38.9\n85.3/36.5\n97.2/77.1\n98.1/78.2\n\n98.9/50.9\n98.4/79.8\n98.9/71.1\n99.1/47.7\n98.6/82.9\n98.5/80.2\n96.2/60.9\n98.6/74.6\n98.6/67.9\n98.7/61.4\n98.6/92.6\n98.4/61.7\n96.8/82.8\n99.6/75.6\n98.9/53.9\n\n98.8/51.0\n98.8/77.0\n99.0/60.5\n99.4/46.0\n98.0/75.4\n94.2/57.2\n96.6/53.5\n97.3/53.8\n98.4/58.1\n99.1/51.8\n99.7/78.2\n99.0/63.1\n99.6/50.3\n99.3/39.1\n99.7/52.7\n\n97.6/75.0\n96.8/65.9\n98.6/46.6\n98.7/65.0\n97.2/23.6\n97.6/55.2\n98.9/43.4\n97.5/86.8\n97.0/75.9\n98.7/34.2\n99.4/56.0\n97.6/37.1\n91.8/66.7\n95.7/54.3\n98.5/63.1\n\n98.5/82.8\n96.2/58.8\n98.9/52.7\n99.4/75.3\n98.6/37.0\n99.3/74.4\n99.7/62.6\n87.5/49.6\n97.0/65.6\n99.8/31.7\n99.3/80.6\n99.4/64.2\n92.5/61.2\n98.7/77.5\n98.4/64.2\n\n96.7/67.9\n97.9/67.6\n91.1/46.6\n94.6/19.6\n90.2/44.9\n76.9/46.8\n94.3/66.2\n93.5/57.4\n98.9/79.9\n66.5/21.1\n88.7/63.9\n96.3/52.4\n55.2/4.4\n92.4/7.9\n92.4/53.1\n\n91.7/41.5\n86.1/34.8\n88.5/11.0\n98.2/54.0\n86.2/28.6\n88.2/20.3\n80.7/5.1\n80.3/20.6\n79.6/22.1\n51.0/5.1\n91.0/54.4\n74.5/4.8\n79.3/11.2\n89.2/10.2\n96.8/42.3\n\n99.4/92.3\n98.8/78.9\n98.5/62.2\n99.0/82.0\n98.4/45.7\n99.7/93.8\n99.7/69.7\n99.7/98.0\n99.5/91.3\n97.5/44.9\n99.6/96.5\n99.6/78.1\n98.4/85.6\n97.8/82.6\n98.8/77.6\n\n99.6/96.5\n98.9/85.3\n99.7/75.6\n99.8/92.1\n99.0/60.1\n99.9/98.5\n99.9/91.7\n99.8/100\n99.9/97.5\n98.8/59.5\n99.8/99.3\n99.5/77.8\n99.6/93.8\n99.9/94.7\n99.6/93.7\n\nAverage\n\n97.7/69.0\n\n96.2/65.5\n\n98.3/66.3\n\n98.3/57.8\n\n97.1/56.6\n\n97.5/62.6\n\n86.4/49.3 84.8/25.7 99.0/78.6\n\n99.6/87.7\n\nParameter Sensitivity: Effect of kmin on Generation Quality\n(Dashed: IS/Realism, Solid: IC-L/Diversity)\n2.50\n\nTable 5. Ablation study on CPO and TACA modules.\n\nwood\n\nAP-P ↑\n71.6\n57.2\n75.6\n59.1\n52.9\n60.1\n91.8\n89.8\n94.7\n\nCable (IC-L)\nCapsule (IC-L)\n\nGrid (IC-L)\nAverage (IC-L)\n\nF1-P ↑\n65.7\n59.8\n69.0\n56.5\n54.6\n57.2\n74.7\n71.1\n76.8\n\n0.500\n0.475\n\n2.40\n\n0.450\n\n2.35\n\nIC-L (Diversity)\n\ngrid\n\nAUC-P ↑\n98.9\n98.8\n99.7\n98.5\n98.3\n99.0\n99.2\n97.5\n99.9\n\nAverage (IS)\nBottle (IC-L)\n\nkmin = 4\n\ncapsule\n\nTACA\n\nCapsule (IS)\nGrid (IS)\n\nOptimal\n\nCPO\n\nIS (Realism)\n\nCategory\n\nBottle (IS)\nCable (IS)\n\n2.45\n\n2.30\n\n0.425\n0.400\n\n2.25\n\n0.375\n\n2.20\n2.15\n2.10\n1\n\n2\n\n0.350\n\nOver-constrained:\nReduced Diversity\nGood Realism\n\nUnder-constrained:\nGood Diversity\nModerate Realism\n\n0.325\n4\n\n8\n\n16\n\nkmin\nFigure 3. Parameter sensitivity\nanalysis of kmin .\n\nwith PRN, the strongest supervised baseline on average, our\nmethod improves AUROC and AP by 0.6 and 9.1 percentage points, respectively. Notable AP gains are observed\non capsule, leather, zipper, and wood, reaching 13.4, 22.0,\n16.1, and 12.1 percentage points, respectively. These results\ndemonstrate the effectiveness of our generated anomalies in\nproviding supervision for accurate anomaly localization.\n\ndiversity trade-off in anomaly generation.\n5.7. Parameter Sensitivity Analysis\nAs illustrated in Fig. 3, we systematically evaluate the impact of kmin ∈ {1, 2, 4, 8, 16} of TACA on generation\nperformance while keeping kmax = 32 fixed as in prior\nwork (Jin et al., 2025) due to its effectiveness. Our timeaware capacity allocation exhibits a smooth yet consistent\ntrade-off between realism (IS, dashed) and diversity (IC-L,\nsolid) across categories. The optimal balance is achieved at\nkmin = 4, where insufficient constraints (kmin &lt; 4) impair\nstructural fidelity despite preserving diversity, while excessive constraints (kmin &gt; 4) reduce diversity without commensurate gains in realism. This behavior systematically\nconfirms that our dynamic rank scheduling effectively regulates the realism–diversity trade-off in few-shot anomaly\n\n5.6. Ablation Study\nAs shown in Tab. 5, our ablation study validates the complementary roles of CPO and TACA modules. CPO proves\ncrucial for enhancing semantic fidelity through implicit preference alignment, as its removal causes significant performance drops in structurally sensitive categories like capsule\nand grid. Meanwhile, TACA consistently contributes to\nmaintaining structural diversity across all categories, with\nits absence leading to noticeable performance degradation.\nThese findings confirm that our framework successfully\ncoordinates optimization objectives to navigate the fidelity8\n\n\fAnomaly-Preference Image Generation\n\ngeneration.\n\nDai, Z., Zeng, S., Liu, H., Li, X., Xue, F., and Zhou,\nY. Seas: few-shot industrial anomaly image generation\nwith separation and sharing fine-tuning. arXiv preprint\narXiv:2410.14987, 2024.\n\n6. Conclusion\nIn this paper, we introduced APO, a novel framework for\nfew-shot anomaly generation. Our method tackles preference alignment without human annotation by leveraging\nanomalies to guide the generative policy through direct preference optimization. To balance diversity and fidelity, we\ndesign a Time-Aware Capacity Allocation (TACA) mechanism and a hierarchical sampling strategy for flexible inference. Extensive experiments show that APO synthesizes\nmore realistic and diverse anomalies, significantly boosting\ndetection performance on industrial benchmarks.\n\nDeng, H. and Li, X. Anomaly detection via reverse distillation from one-class embedding. In Proceedings of the\nIEEE/CVF conference on computer vision and pattern\nrecognition, pp. 9737–9746, 2022.\nDing, C., Pang, G., and Shen, C. Catching both gray and\nblack swans: Open-set supervised anomaly detection. In\nProceedings of the IEEE/CVF conference on computer\nvision and pattern recognition, pp. 7388–7398, 2022.\nDuan, Y., Hong, Y., Niu, L., and Zhang, L. Few-shot defect\nimage generation via defect-aware feature manipulation.\nIn Proceedings of the AAAI conference on artificial intelligence, volume 37, pp. 571–578, 2023.\n\nImpact Statement\nThis paper presents work whose goal is to advance the field\nof Machine Learning, specifically focusing on data-efficient\nanomaly synthesis. The primary application of our method\nis to improve the robustness and reliability of automated\ninspection systems in industrial manufacturing and medical\nimaging. By reducing the dependency on extensive anomalous data, our work contributes to enhanced quality control\nstandards and operational efficiency. We do not foresee any\nspecific negative ethical aspects or societal consequences\nassociated with this research.\n\nFan, Y., Watkins, O., Du, Y., Liu, H., Ryu, M., Boutilier,\nC., Abbeel, P., Ghavamzadeh, M., Lee, K., and Lee, K.\nDpok: Reinforcement learning for fine-tuning text-toimage diffusion models. Advances in Neural Information\nProcessing Systems, 36:79858–79885, 2023.\nHong, J., Lee, N., and Thorne, J. Orpo: Monolithic preference optimization without reference model. arXiv\npreprint arXiv:2403.07691, 2024.\nHu, T., Zhang, J., Yi, R., Du, Y., Chen, X., Liu, L., Wang,\nY., and Wang, C. Anomalydiffusion: Few-shot anomaly\nimage generation with diffusion model. In Proceedings of\nthe AAAI conference on artificial intelligence, volume 38,\npp. 8526–8534, 2024.\n\nReferences\nBai, Y., Jones, A., Ndousse, K., Askell, A., Chen, A., DasSarma, N., Drain, D., Fort, S., Ganguli, D., Henighan, T.,\net al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint\narXiv:2204.05862, 2022a.\n\nJin, Y., Peng, J., He, Q., Hu, T., Wu, J., Chen, H., Wang, H.,\nZhu, W., Chi, M., Liu, J., et al. Dual-interrelated diffusion\nmodel for few-shot anomaly image generation. In Proceedings of the Computer Vision and Pattern Recognition\nConference, pp. 30420–30429, 2025.\n\nBai, Y., Kadavath, S., Kundu, S., Askell, A., Kernion, J.,\nJones, A., Chen, A., Goldie, A., Mirhoseini, A., McKinnon, C., et al. Constitutional ai: Harmlessness from ai\nfeedback. arXiv preprint arXiv:2212.08073, 2022b.\n\nKingma, D. P. Adam: A method for stochastic optimization.\narXiv preprint arXiv:1412.6980, 2014.\n\nBergmann, P., Fauser, M., Sattlegger, D., and Steger, C.\nMvtec ad–a comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the\nIEEE/CVF conference on computer vision and pattern\nrecognition, pp. 9592–9600, 2019.\n\nLee, K., Liu, H., Ryu, M., Watkins, O., Du, Y., Boutilier, C.,\nAbbeel, P., Ghavamzadeh, M., and Gu, S. S. Aligning textto-image models using human feedback. arXiv preprint\narXiv:2302.12192, 2023.\nLee, S., Lee, S., and Song, B. C. Cfa: Coupled-hyperspherebased feature adaptation for target-oriented anomaly localization. IEEE Access, 10:78446–78454, 2022.\n\nBradley, R. A. and Terry, M. E. Rank analysis of incomplete block designs: I. the method of paired comparisons.\nBiometrika, 39(3/4):324–345, 1952.\n\nLi, C.-L., Sohn, K., Yoon, J., and Pfister, T. Cutpaste:\nSelf-supervised learning for anomaly detection and localization. In Proceedings of the IEEE/CVF conference on\ncomputer vision and pattern recognition, pp. 9664–9674,\n2021.\n\nChristiano, P. F., Leike, J., Brown, T., Martic, M., Legg,\nS., and Amodei, D. Deep reinforcement learning from\nhuman preferences. Advances in neural information processing systems, 30, 2017.\n9\n\n\fAnomaly-Preference Image Generation\n\nLi, X., Huang, Z., Xue, F., and Zhou, Y. Musc: Zero-shot\nindustrial anomaly classification and segmentation with\nmutual scoring of the unlabeled images. In The Twelfth\nInternational Conference on Learning Representations,\n2024.\n\nWang, F., Zhang, T., Wang, Y., Qiu, Y., Liu, X., Guo, X.,\nand Cui, Z. Distribution prototype diffusion learning for\nopen-set supervised anomaly detection. In Proceedings of\nthe Computer Vision and Pattern Recognition Conference,\npp. 20416–20426, 2025.\n\nLin, D., Cao, Y., Zhu, W., and Li, Y. Few-shot defect\nsegmentation leveraging abundant defect-free training\nsamples through normal background regularization and\ncrop-and-paste operation. In 2021 IEEE International\nConference on Multimedia and Expo (ICME), pp. 1–6.\nIEEE Computer Society, 2021.\n\nZavrtanik, V. and Kristan, Matej, D. Draem-a discriminatively trained reconstruction embedding for surface\nanomaly detection. In Proceedings of the IEEE/CVF\ninternational conference on computer vision, pp. 8330–\n8339, 2021.\nZhang, H., Wu, Z., Wang, Z., Chen, Z., and Jiang, Y.-G.\nPrototypical residual networks for anomaly detection and\nlocalization. In Proceedings of the IEEE/CVF Conference\non Computer Vision and Pattern Recognition, pp. 16281–\n16291, 2023.\n\nPang, G., Ding, C., Shen, C., and Hengel, A. v. d. Explainable deep few-shot anomaly detection with deviation\nnetworks. arXiv preprint arXiv:2108.00462, 2021.\nRafailov, R., Sharma, A., Mitchell, E., Manning, C. D.,\nErmon, S., and Finn, C. Direct preference optimization: Your language model is secretly a reward model.\nAdvances in neural information processing systems, 36:\n53728–53741, 2023.\n\nZhao, Y., Joshi, R., Liu, T., Khalman, M., Saleh, M., and\nLiu, P. J. Slic-hf: Sequence likelihood calibration with\nhuman feedback. arXiv preprint arXiv:2305.10425, 2023.\n\nRistea, N., Ionescu, R. T., Nasrollahi, K., Khan, F. S., Moeslund, T. B., and Shah, M. Self-supervised predictive\nconvolutional attentive block for anomaly detection. In\nProceedings of the IEEE/CVF conference on computer\nvision and pattern recognition, pp. 13576–13586, 2022.\nRombach, R., Blattmann, A., Lorenz, D., Esser, P., and\nOmmer, B. High-resolution image synthesis with latent\ndiffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp.\n10684–10695, 2022.\nRoth, K., Pemula, L., Zepeda, J., Schölkopf, B., Brox, T.,\nand Gehler, P. Towards total recall in industrial anomaly\ndetection. In Proceedings of the IEEE/CVF conference\non computer vision and pattern recognition, pp. 14318–\n14328, 2022.\nSong, J., Meng, C., and Ermon, S. Denoising diffusion\nimplicit models. arXiv preprint arXiv:2010.02502, 2020.\nSun, H., Cao, Y., Dong, H., and Fink, O. Unseen visual\nanomaly generation. In Proceedings of the Computer\nVision and Pattern Recognition Conference, pp. 25508–\n25517, 2025.\nWallace, B., Dang, M., Rafailov, R., Zhou, L., Lou, A.,\nPurushwalkam, S., Ermon, S., Xiong, C., Joty, S., and\nNaik, N. Diffusion model alignment using direct preference optimization. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition,\npp. 8228–8238, 2024.\n10\n\n\fAnomaly-Preference Image Generation\n\nA. Ablation Study on Regularization Coefficient β\nThe regularization coefficient β governs the fundamental trade-off in our constrained optimization framework, determining\nthe extent to which the model adapts to few-shot anomalies while preventing overfitting. As shown in Tab. 6, β exhibits a\npronounced effect on generation fidelity and downstream detection performance.\nWe observe that β = 1000 achieves optimal balance, yielding superior results in both anomaly realism (IS: 2.14) and\ndetection capability (AP-P: 87.7%). This setting allows sufficient adaptation to learn target anomaly patterns while\nmaintaining the stability essential for few-shot learning. The performance degradation at β = 500 confirms the risk of\noverfitting in data-scarce regimes, where excessive adaptation compromises the model’s ability to generate structurally\ncoherent anomalies. Conversely, the constrained adaptation at β = 2000 demonstrates the importance of allowing adequate\ndistributional shift for meaningful anomaly learning. These findings validate that our direct preference optimization provides\neffective control over the adaptation degree, with β = 1000 establishing the optimal operating point that enables precise\nanomaly alignment while preserving the essential characteristics of the base generative model.\nTable 6. Ablation study on regularization coefficient β. Results report average performance across MVTec AD categories.\nβ\n\nIS ↑\n\nIC-LPIPS ↑\n\nAUC-P ↑\n\nAP-P ↑\n\n500\n1000\n2000\n\n2.08\n2.14\n2.11\n\n0.39\n0.41\n0.40\n\n99.4\n99.6\n99.5\n\n86.2\n87.7\n87.1\n\nBest Baseline\n\n2.02\n\n0.38\n\n99.1\n\n84.5\n\nB. Additional Theoretical Analysis of Anomaly Preference Optimization\nThis appendix provides the complete derivation of the key formulas in the main text to ensure theoretical rigor and readability.\nWe begin with the fundamental theory of diffusion models and progressively derive the APO objective function.\nB.1. Trajectory-Level KL Divergence Formulation\nWe first establish the theoretical foundation at the trajectory level. Let q(z0:T |x) denote the forward diffusion process and\npθ (z0:T |c) the reverse generation process. The KL deviation function defined in the main text is:\n  \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) &amp;= D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})) \\nonumber \\\\ &amp;- D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})).\n(21)\nThis trajectory-level KL divergence decomposes into per-timestep components:\n\n  \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) &amp;= \\sum _{t=1}^T \\mathbb {E}_{q(\\mathbf {z}_{t}|\\mathbf {x})} \\nonumber \\\\ &amp;\\Big [ D_{\\text {KL}}(q(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c})) \\nonumber \\\\ &amp;\\quad - D_{\\text {KL}}(q(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {x}) \\| p_\\theta (\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c})) \\Big ].\n\n(22)\nFor each timestep t, all three conditionals q(zt−1 |zt , x), pref (zt−1 |zt , c) and pθ (zt−1 |zt , c) are Gaussians with the same\ncovariance but different means. Under the noise-prediction parameterization, we have\n  q(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {x}) &amp;= \\mathcal {N}\\bigl (\\mathbf {z}_{t-1}; \\boldsymbol {\\mu }_q(\\mathbf {z}_t,\\mathbf {z}_0), \\sigma _t^2 \\mathbf {I} \\bigr ), \\\\ p_{\\text {ref}}(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c}) &amp;= \\mathcal {N}\\bigl (\\mathbf {z}_{t-1}; \\boldsymbol {\\mu }_{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t), \\sigma _t^2 \\mathbf {I} \\bigr ), \\\\ p_\\theta (\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c}) &amp;= \\mathcal {N}\\bigl (\\mathbf {z}_{t-1}; \\boldsymbol {\\mu }_\\theta (\\mathbf {z}_t,\\mathbf {c},t), \\sigma _t^2 \\mathbf {I} \\bigr ),\n(25)\n11\n\n\fAnomaly-Preference Image Generation\n\nwhere the variance σt2 I is shared, and the means are given by the standard DDPM parameterization:\n  \\boldsymbol {\\mu }_q(\\mathbf {z}_t,\\mathbf {z}_0) &amp;= \\frac {1}{\\sqrt {\\alpha _t}} \\Bigl ( \\mathbf {z}_t - \\frac {1-\\alpha _t}{\\sqrt {1-\\bar {\\alpha }_t}} \\boldsymbol {\\epsilon } \\Bigr ), \\\\ \\boldsymbol {\\mu }_{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) &amp;= \\frac {1}{\\sqrt {\\alpha _t}} \\Bigl ( \\mathbf {z}_t - \\frac {1-\\alpha _t}{\\sqrt {1-\\bar {\\alpha }_t}} \\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) \\Bigr ), \\\\ \\boldsymbol {\\mu }_\\theta (\\mathbf {z}_t,\\mathbf {c},t) &amp;= \\frac {1}{\\sqrt {\\alpha _t}} \\Bigl ( \\mathbf {z}_t - \\frac {1-\\alpha _t}{\\sqrt {1-\\bar {\\alpha }_t}} \\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) \\Bigr ),\n\n(28)\nwith zt =\n\n√\n\nᾱt z0 +\n\n√\n\n1 − ᾱt ϵ and ϵ ∼ N (0, I).\n\nSince the covariances are identical, the KL divergence between q and a generic Gaussian p = N (µp , σt2 I) simplifies to:\n  D_{\\text {KL}}(q \\| p) = \\frac {1}{2\\sigma _t^2} \\|\\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_p\\|_2^2 + \\text {const.} \n\n(29)\n\nApplying this to pref and pθ and taking the difference gives:\n  &amp;D_{\\text {KL}}(q(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c})) \\nonumber \\\\ &amp;\\quad - D_{\\text {KL}}(q(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {x}) \\| p_{\\theta }(\\mathbf {z}_{t-1}|\\mathbf {z}_t,\\mathbf {c})) \\nonumber \\\\ &amp;= \\frac {1}{2\\sigma _t^2} \\Bigl ( \\|\\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_{\\text {ref}}\\|_2^2 - \\|\\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_\\theta \\|_2^2 \\Bigr ). \\label {eq:app_gaussian_kl_diff}\n\n(30)\nUsing the explicit forms of the means, we observe that:\n  \\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_{\\text {ref}} &amp;= \\frac {1-\\alpha _t}{\\sqrt {\\alpha _t(1-\\bar {\\alpha }_t)}} \\bigl (\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\bigr ), \\\\ \\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_\\theta &amp;= \\frac {1-\\alpha _t}{\\sqrt {\\alpha _t(1-\\bar {\\alpha }_t)}} \\bigl (\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\bigr ),\n(32)\nso that:\n  \\|\\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_{\\text {ref}}\\|_2^2 &amp;= \\frac {(1-\\alpha _t)^2}{\\alpha _t(1-\\bar {\\alpha }_t)} \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2, \\\\ \\|\\boldsymbol {\\mu }_q - \\boldsymbol {\\mu }_\\theta \\|_2^2 &amp;= \\frac {(1-\\alpha _t)^2}{\\alpha _t(1-\\bar {\\alpha }_t)} \\|\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2.\n(34)\nSubstituting these into Eqn. (30) yields:\n  &amp;D_{\\text {KL}}(q \\| p_{\\text {ref}}) - D_{\\text {KL}}(q \\| p_\\theta ) \\nonumber \\\\ &amp;= \\frac {(1-\\alpha _t)^2}{2\\sigma _t^2\\alpha _t(1-\\bar {\\alpha }_t)} \\left ( \\|\\boldsymbol {\\epsilon } - \\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 - \\|\\boldsymbol {\\epsilon } - \\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 \\right ).\n(35)\nDefining:\n  \\lambda '_t = \\frac {(1-\\alpha _t)^2}{\\sigma _t^2\\alpha _t(1-\\bar {\\alpha }_t)} \nas in the main text, and using the standard reparameterization zt =\nthe trajectory-level deviation function becomes:\n\n√\n\nᾱt z0 +\n\n(36)\n√\n\n1 − ᾱt ϵ with t ∼ U(1, T ) and ϵ ∼ N (0, I),\n\n  &amp;\\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) = \\sum _{t=1}^T \\mathbb {E}_{q(\\mathbf {z}_t|\\mathbf {x})} \\Big [ D_{\\text {KL}}(q \\| p_{\\text {ref}}) - D_{\\text {KL}}(q \\| p_\\theta ) \\Big ] \\nonumber \\\\ &amp;= \\frac {1}{2} \\mathbb {E}_{t \\sim \\mathcal {U}(0,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\bigg [ \\lambda '_t \\Big ( \\|\\boldsymbol {\\epsilon } - \\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 \\nonumber \\\\ &amp;\\quad - \\|\\boldsymbol {\\epsilon } - \\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 \\Big ) \\bigg ],\n\n(37)\nwhich is the tractable deviation function used in the main text.\n12\n\n\fAnomaly-Preference Image Generation\n\nB.2. Reward Reparameterization and Preference Modeling\nIn order to relate the implicit reward to the KL deviation, we extend the optimal policy form to the trajectory level. Analogous\nto the endpoint case, we write:\n  p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c}) = \\frac {1}{Z(\\mathbf {c})} p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c}) \\exp \\left (\\frac {\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})}{\\beta }\\right ), \n\n(38)\n\nwhere Z(c) is the partition function that does not depend on the particular trajectory z0:T . Taking logarithms on both sides\nyields the reward reparameterization:\n  \\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c}) = \\beta \\Big ( \\log p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c}) - \\log p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c}) \\Big ) + \\beta \\log Z(\\mathbf {c}). \\label {eq:app_reward_reparam} \n\n(39)\n\nWe now take expectation with respect to the forward process q(z0:T |x):\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] &amp;= \\beta \\Big ( \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} [\\log p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})] \\nonumber \\\\ &amp;\\quad - \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} [\\log p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})] \\Big ) \\nonumber \\\\ &amp;\\quad + \\beta \\log Z(\\mathbf {c}). \\label {eq:app_reward_exp_1}\n\n(40)\nOn the other hand, by definition of the KL divergence we have:\n  D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})) &amp;= \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [ \\log q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\nonumber \\\\ &amp;\\quad - \\log p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c}) \\big ], \\\\ D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})) &amp;= \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [ \\log q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\nonumber \\\\ &amp;\\quad - \\log p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c}) \\big ].\n\n(42)\nSubtracting these two expressions, we obtain:\n  &amp;D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})) - D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})) \\nonumber \\\\ &amp;= \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [ \\log p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c}) - \\log p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c}) \\big ].\n(43)\nUsing the deviation function defined in the main text,\n  \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) &amp;= D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})) \\nonumber \\\\ &amp;\\quad - D_{\\text {KL}}(q(\\mathbf {z}_{0:T}|\\mathbf {x}) \\| p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})),\n(44)\nwe can rewrite the expectation difference in Eqn. (40) as:\n  &amp;\\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} [\\log p_\\theta (\\mathbf {z}_{0:T}|\\mathbf {c})] - \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} [\\log p_{\\text {ref}}(\\mathbf {z}_{0:T}|\\mathbf {c})]\\nonumber \\\\ &amp; = \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}).\n(45)\nSubstituting this into Eqn. (40) gives the desired relation:\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})] = \\beta \\cdot \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) + \\beta \\log Z(\\mathbf {c}), \n\n(46)\n\nwhich is the equation stated in the main text. It shows that, up to an additive constant independent of the particular anomaly\nsample x, maximizing the expected implicit reward is equivalent to maximizing the KL deviation δ(pθ , pref ; x, c).\nTo construct a practical optimization objective, we now connect the trajectory-level deviation δ(pθ , pref ; x, c) with an\ninstantaneous deviation in noise space. From the previous subsection, we have already obtained the closed-form expression\n\n  &amp;\\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) = \\frac {1}{2} \\mathbb {E}_{t \\sim \\mathcal {U}(1,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\nonumber \\\\ &amp;\\quad \\left [ \\lambda '_t \\left ( \\|\\boldsymbol {\\epsilon } - \\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 - \\|\\boldsymbol {\\epsilon } - \\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t)\\|_2^2 \\right ) \\right ],\n(47)\n13\n\n\fAnomaly-Preference Image Generation\n2\n\nt)\nand zt =\nwhere λ′t = σ2(1−α\nαt (1−ᾱt )\nt\n\n√\n\nᾱt z0 +\n\n√\n\n1 − ᾱt ϵ.\n\nIn the main text, the instantaneous deviation is defined as\n  \\Delta = \\|\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2, \n\n(48)\n\nwhich is simply the negative of the bracketed term above, since squared distances are symmetric:\n  &amp;\\|\\boldsymbol {\\epsilon } - \\epsilon _{\\text {ref}}\\|_2^2 - \\|\\boldsymbol {\\epsilon } - \\epsilon _\\theta \\|_2^2 = \\|\\epsilon _{\\text {ref}} - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _\\theta - \\boldsymbol {\\epsilon }\\|_2^2 \\nonumber \\\\ &amp;= -\\Big ( \\|\\epsilon _\\theta - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _{\\text {ref}} - \\boldsymbol {\\epsilon }\\|_2^2 \\Big ) = -\\Delta .\n(49)\nSubstituting this identity into the deviation expression yields the precise relation between the trajectory-level deviation and\nthe instantaneous deviation:\n  \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) = -\\frac {1}{2} \\mathbb {E}_{t \\sim \\mathcal {U}(1,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\big [ \\lambda '_t \\Delta \\big ]. \\label {eq:app_delta_delta} \n(50)\nCombining Eqn. (50) with the reward reparameterization:\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] = \\beta \\cdot \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) + \\beta \\log Z(\\mathbf {c}), \n\n(51)\n\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] &amp;= -\\frac {\\beta }{2} \\mathbb {E}_{t, \\boldsymbol {\\epsilon }} \\big [ \\lambda '_t \\Delta \\big ] + \\beta \\log Z(\\mathbf {c}).\n\n(52)\n\nwe obtain:\n\nDefining a time-dependent scaling factor:\n  \\beta _t = \\frac {1}{2}\\beta \\lambda '_t, \n\n(53)\n\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] = -\\mathbb {E}_{t, \\boldsymbol {\\epsilon }} \\big [ \\beta _t \\Delta \\big ] + \\beta \\log Z(\\mathbf {c}). \n\n(54)\n\nthis can be rewritten as:\nThe constant term log Z(c) does not affect optimization with respect to θ, so the effective reward margin is proportional to\n−βt ∆. Intuitively, when the policy denoiser ϵθ is closer to the true noise than the reference ϵref , we have ∆ &lt; 0 and thus\n−βt ∆ &gt; 0, indicating a higher implicit reward for the policy.\nTo convert this margin into a practical learning objective, we adopt the Bradley–Terry preference model. For each noisy\nlatent state (zt , c, t, ϵ), we model the probability that the policy pθ is preferred over the reference model pref as\n  P\\big (p_\\theta \\succ p_{\\text {ref}} \\mid \\mathbf {x},\\mathbf {c},t,\\boldsymbol {\\epsilon }\\big ) = \\sigm \\big (-\\beta _t \\Delta \\big ), \n\n(55)\n\nwhere sigmoid(·) is the sigmoid function and −βt ∆ serves as the preference logit. Under this formulation, a better policy\n(with smaller denoising error than the reference, i.e., ∆ &lt; 0) yields a positive logit and thus a preference probability greater\nthan 0.5.\nMaximizing this preference probability over the training distribution is equivalent to minimizing the negative log-likelihood\n  \\mathcal {L}_{\\text {APO}} = \\mathbb {E}_{t \\sim \\mathcal {U}(0,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\Big [ - \\log \\sigm \\big (-\\beta _t \\Delta \\big ) \\Big ], \n\n(56)\n\nwhich is exactly the APO objective used in the main text. This derivation shows that the instantaneous deviation ∆ provides\na consistent bridge from the trajectory-level KL deviation to a DPO-style preference loss, while the time-dependent factor\nβt reflects the contribution of each diffusion timestep as induced by the ELBO weights λ′t .\nB.3. Final APO Objective\nFrom the previous subsection, the trajectory-level deviation can be written in latent noise space as:\n  &amp;\\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) = \\frac {1}{2} \\mathbb {E}_{t \\sim \\mathcal {U}(0,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\nonumber \\\\ &amp;\\Big [ \\lambda '_t \\big ( \\|\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 \\big ) \\Big ],\n(57)\n14\n\n\fAnomaly-Preference Image Generation\n\nwhich matches Eqn. (14) in the main text. For notational convenience, we define the instantaneous deviation:\n  \\Delta = \\|\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 - \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2, \n\n(58)\n\n  \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) = \\frac {1}{2} \\mathbb {E}_{t, \\boldsymbol {\\epsilon }} \\big [ \\lambda '_t \\Delta \\big ]. \n\n(59)\n\nso that:\n\nCombining this expression with the reward reparameterization,\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] = \\beta \\cdot \\delta (p_\\theta , p_{\\text {ref}}; \\mathbf {x},\\mathbf {c}) + \\beta \\log Z(\\mathbf {c}), \n\n(60)\n\n  \\mathbb {E}_{q(\\mathbf {z}_{0:T}|\\mathbf {x})} \\big [\\mathcal {R}(\\mathbf {z}_{0:T},\\mathbf {c})\\big ] &amp;= \\frac {\\beta }{2} \\mathbb {E}_{t, \\boldsymbol {\\epsilon }} \\big [ \\lambda '_t \\Delta \\big ] + \\beta \\log Z(\\mathbf {c}).\n\n(61)\n\nwe obtain:\n\nFor a fixed tuple (x, c, t, ϵ), this suggests a local reward margin:\n  m(\\mathbf {x},\\mathbf {c},t,\\boldsymbol {\\epsilon }) = \\frac {\\beta }{2}\\lambda '_t \\Delta . \n\n(62)\n\nTo match the notation in the main text, we reparameterize this margin via a time-dependent weight:\n  \\beta _t := -\\frac {1}{2}\\beta \\lambda '_t, \n\n(63)\n\n  m(\\mathbf {x},\\mathbf {c},t,\\boldsymbol {\\epsilon }) = -\\beta _t \\Delta . \n\n(64)\n\nso that:\nIn other words, the effective reward margin is proportional to the scaled deviation −βt ∆ used in Eqn. (15).\nAdopting the Bradley–Terry model at the denoising level, we model the probability that the policy pθ is preferred over the\nreference model pref as:\n  P\\big (p_\\theta \\succ p_{\\text {ref}} \\mid \\mathbf {x},\\mathbf {c},t,\\boldsymbol {\\epsilon }\\big ) = \\sigm \\big (-\\beta _t \\Delta \\big ), \n(65)\nwhere the logit is exactly the margin m(x, c, t, ϵ) = −βt ∆. Maximizing this preference probability over the training\ndistribution is equivalent to minimizing the negative log-likelihood:\n  \\mathcal {L}_{\\text {APO}} &amp;= \\mathbb {E}_{t \\sim \\mathcal {U}(0,T),\\, \\boldsymbol {\\epsilon } \\sim \\mathcal {N}(\\mathbf {0},\\mathbf {I})} \\Big [ -\\log \\sigm \\big (-\\beta _t \\Delta \\big ) \\Big ] \\nonumber \\\\ &amp;\\quad = \\mathbb {E}_{t, \\boldsymbol {\\epsilon }} \\Big [ -\\log \\sigm \\big ( -\\beta _t \\big ( \\|\\epsilon _\\theta (\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 \\nonumber \\\\ &amp;\\quad - \\|\\epsilon _{\\text {ref}}(\\mathbf {z}_t,\\mathbf {c},t) - \\boldsymbol {\\epsilon }\\|_2^2 \\big ) \\big ) \\Big ],\n\n(66)\nwhich recovers the APO objective in Eqn. (15) of the main text. This final expression is mathematically consistent with the\ntrajectory-level KL deviation, the reward reparameterization, and the time-dependent weighting scheme, thereby providing a\nrigorous foundation for the proposed APO model.\n\n15\n\n\f</code></pre></article>\n        \n</main>\n\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js\"></script>\n<script>\n\nfunction initTheme() {\n  const saved = localStorage.getItem('kb-theme') || 'light';\n  document.documentElement.setAttribute('data-theme', saved);\n  updateThemeIcon(saved);\n}\nfunction toggleTheme() {\n  const cur = document.documentElement.getAttribute('data-theme') || 'light';\n  const next = cur === 'light' ? 'dark' : 'light';\n  document.documentElement.setAttribute('data-theme', next);\n  localStorage.setItem('kb-theme', next);\n  updateThemeIcon(next);\n}\nfunction updateThemeIcon(t) {\n  const btn = document.getElementById('theme-toggle-btn');\n  if (btn) btn.innerHTML = t === 'dark' ? '☀️' : '🌙';\n}\ndocument.addEventListener('DOMContentLoaded', initTheme);\n\nfunction setViewMode(m) {\n  const grid = document.getElementById('bento-grid-view');\n  const list = document.getElementById('list-table-view');\n  const bGrid = document.getElementById('view-grid-btn');\n  const bList = document.getElementById('view-list-btn');\n  if (m === 'list') {\n    if (grid) grid.style.display = 'none';\n    if (list) list.style.display = 'flex';\n    if (bGrid) bGrid.classList.remove('active');\n    if (bList) bList.classList.add('active');\n  } else {\n    if (grid) grid.style.display = 'grid';\n    if (list) list.style.display = 'none';\n    if (bGrid) bGrid.classList.add('active');\n    if (bList) bList.classList.remove('active');\n  }\n  localStorage.setItem('kb-view', m);\n}\ndocument.addEventListener('DOMContentLoaded', () => {\n  const s = localStorage.getItem('kb-view') || 'grid';\n  setViewMode(s);\n});\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  document.querySelectorAll('pre').forEach(pre => {\n    const b = document.createElement('button');\n    b.className = 'copy-code-btn';\n    b.innerText = 'Copy';\n    b.onclick = () => {\n      const c = pre.querySelector('code') ? pre.querySelector('code').innerText : pre.innerText;\n      navigator.clipboard.writeText(c).then(() => {\n        b.innerText = 'Copied!';\n        setTimeout(() => { b.innerText = 'Copy'; }, 2000);\n      });\n    };\n    pre.appendChild(b);\n  });\n});\n\nwindow.addEventListener('keydown', (e) => {\n  if ((e.key === '/' || (e.metaKey && e.key === 'k')) && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n    const q = document.getElementById('global-search-input');\n    if (q) q.focus();\n  }\n});\n\n// Scrollspy for TOC\nwindow.addEventListener('scroll', () => {\n  const headers = document.querySelectorAll('.article-body h1, .article-body h2, .article-body h3');\n  const scrollPos = window.scrollY + 100;\n  headers.forEach(h => {\n    if (h.offsetTop <= scrollPos) {\n      const id = h.getAttribute('id');\n      if (id) {\n        document.querySelectorAll('.reading-sidebar a').forEach(a => {\n          a.classList.toggle('active', a.getAttribute('href') === '#' + id);\n        });\n      }\n    }\n  });\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  if (window.renderMathInElement) {\n    renderMathInElement(document.body, {\n      delimiters: [\n        {left: '$$', right: '$$', display: true},\n        {left: '$', right: '$', display: false},\n      ],\n      throwOnError : false\n    });\n  }\n});\n</script>\n\n</body>\n</html>\n"