"<!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>This CVPR paper is the Open Access version, provided by the Computer Vision Foundation.\nExcept for this watermark, it is identical to the accepted version;\nthe final published version of the proceedings is available on IEEE Xplore.\n\nHunting Normality from Query Sample via Residual Learning for Generalist\nAnomaly Detection\nXiaolei Wang1,2\n\nYuexin Wang1,2 Tianhong Dai4 Huihui Bai3 Yao Zhao3\nXi’an Jiaotong-Liverpool University 2 University of Liverpool\n3\nBeijing Jiaotong University 4 Applied Computing Technologies\n\nJimin Xiao1 *\n\n1\n\nAbstract\nGeneralist Anomaly Detection (GAD) seeks to overcome the\ndomain-specific limitations of traditional anomaly detection\nby training a unified model that can generalize to unseen\nclasses. A promising GAD strategy involves using residual\nfeatures to create a class-invariant space. However, existing methods that directly model the distribution of residuals face unpredictable risks: there is inconsistency between\nresidual and instance features, i.e., subtle defects may yield\nsmall residuals (false negatives), or normal feature residuals could be large due to the diversity of normality (false\npositives). To address these limitations, we propose a novel\nresidual-based learning framework that re-purposes residuals as a guide to learn instance-level normality, rather than\nmodeling their distribution directly. Our framework features two new attention-based modules: Residual Feature\nLearning (RFL), which uses learnable proxies to capture\ndiverse patterns from the residual features, and Normality\nLearning from Support (NLS), which leverages these residual proxies to aggregate query-related normality proxies\nfrom the support instance features. These dynamically generated normality proxies are then used to hunt for normality\nwithin the query patch features, enabling accurate anomaly\nlocalization. Extensive experiments on GAD benchmarks\ndemonstrate the effectiveness of our method. Code is available at HNQ-GAD.\n\nunseen classes. To address existing limitations, Generalist Anomaly Detection (GAD) [47, 56] has emerged, which\nseeks to train one unified model on the source domain that\ncan generalize to detect anomalies in diverse, unseen classes\nfrom the target domain.\nA promising solution for tackling this class generalization challenge is ‘residual feature’. A residual feature is\ncomputed by subtracting the nearest normal support feature from a query feature [47, 56]. This operation effectively removes class-specific information, creating a more\nclass-invariant feature space (see Fig.1a). Recently, ResAD\n[47] proposes to learn the distribution of normal residual\nfeatures, assuming that anomalies will produce residuals\nthat fall out of distribution. However, this method simply\nassumes that the residual feature distribution is consistent\nwith the original feature distribution, i.e., normal residuals tend to cluster together while abnormal ones are located\noutside of the normal residual cluster. Actually, the abnormal residual is only an indirect signal of abnormality, and\nthe significant difference between query and support may\nnot necessarily indicate abnormality. As shown in Fig.1b,\na subtle defect may produce a small residual that is incorrectly classified as normal (false negatives). Conversely, the\nresiduals calculated with two normal features may also be\nlarge due to the diversity of normality (false positives). The\ninconsistency between residuals and instance features indicates that modeling residual distributions directly carries\nunpredictable risks.\nTo address these limitations, we propose a novel framework that fully exploits the cross-domain capabilities of\nresiduals while mitigating their inherent risks. Recognizing that residuals possess inherent transferability across domains, we first leverage initialized proxies to learn diverse\nand rich residual patterns. Subsequently, to ensure consistency between residual and instance features, these residualbased proxies serve as guidance signals and are transferred\ninto the normal instance space to learn normal instance patterns. This process is facilitated by a second attention-based\nmodule, which utilizes residual-based proxies to adaptively\naggregate the most representative normal instance proto-\n\n1. Introduction\nVisual anomaly detection (AD), a critical task with applications ranging from industrial inspection [11, 18, 38, 44] to\nmedical diagnosis [13, 22], aims to identify rare samples or\nunexpected patterns that deviate from an established definition of normality. Traditional AD approaches [12, 51, 52]\ngenerally train and test a single model within a single, fixed\ndomain. This approach lacks transferability, as these models must be retrained or fine-tuned when deployed on new,\n* Corresponding Author\n\n43093\n\n\fQuery Features\n\nResidual Features\n\nResidual Distribution\n\nLearned Boundary\n\nNormal\n\nAbnormal\n\nResidual Distribution\n\nHistogram of L2 Norm of Residual\n\nSubtle Defect\n\n(a) T-SNE Visualization of Query and Residual Features\n\nFalse Positive\n\nDensity\n\nFalse Negative\n\nL2 Norm of Residual\n\nNormal\n\n(b) Inconsistency between Residuals and Instance Features\n\nFigure 1. (a) The residual feature effectively removes class-specific information compared to instance features. (b) The inconsistency\nbetween residuals and instance features. A subtle defect may produce a small residual that is incorrectly classified as normal (false\nnegatives). Conversely, the residuals calculated with two normal features may also be large (false positives).\n\neralizing and detecting anomalies in target domains.\n\ntypes from the support set. By ‘hunting normality’ using\nthese dynamically generated prototypes based on the specific support and query pairs rather than relying solely on\nstatic residual distributions, our approach robustly generalizes to new domains while maintaining accurate anomaly\nlocalization. It should be noted that we consider that the patterns of abnormal residuals and instance features are complex, and abnormal residuals are more likely to overlap with\nnormal residuals (Fig.1b). Therefore, we prefer to focus on\ncapturing the normality within the query.\n\n2. Related Work\n2.1. Anomaly Detection\n\nTo implement this, we propose a novel residual-based\nlearning framework centered on two new attention-based\nmodules: Residual Feature Learning (RFL) and Normality\nLearning from Support (NLS). The RFL module first utilizes a set of learnable proxies to process the residual features, capturing their diverse patterns and outputting a set\nof residual proxies. Next, the NLS module leverages these\nresidual proxies to learn representative normality patterns\nfrom the support set features, generating an adaptive set\nof normality proxies. Finally, these dynamically generated\nnormality proxies are used to hunt for normality within the\nquery patch features to achieve anomaly localization. The\ninsight of this framework is to learn a transferable relationship between residual patterns and instance-level normality,\nthereby using residuals as a guide to learn instance-level\nnormality rather than modeling their distribution directly.\nOur contributions can be summarized as follows:\n(1) We identify that modeling residual feature distribution\ndirectly in GAD tasks carries significant risks, as the inconsistency between residuals and instance features degrades\ndistribution modeling.\n(2) We propose a novel framework that re-purposes residual\nfeatures as a guide to learn instance-level normality patterns\nfrom the support set, mitigating the inherent risks in GAD.\n(3) The proposed method achieves competitive performance\non GAD benchmarks, demonstrating its superiority in gen-\n\nVisual Anomaly Detection (AD) aims to identify samples\nor patterns that deviate from our familiar normal one. AD\ncan be divided into multiple sub-tasks based on real-world\nneeds, such as unsupervised AD [3, 38, 42, 43, 45, 48, 50],\nfew-shot AD (FSAD) [14, 23, 27], zero-shot AD (ZSAD)\n[4, 16, 35, 55], noisy AD [6, 26], open-set AD [13, 57],\nand 3D AD [8, 29, 54]. Most traditional AD methods\nfollow a one-for-one or one-for-many paradigm, focusing\non training and testing a model within a single domain.\nThese methods are typically unsupervised, adopting a oneclass classification paradigm (OCC) [39] where the model\nis trained only on normal samples to identify unseen abnormal patterns. These unsupervised methods generally fall\ninto three main categories: reconstruction-based method\n[19–21, 34, 40, 44], feature-embedding-based method [28],\nand augmentation-based method [5, 9, 53]. While effective,\nthese unsupervised methods are designed to detect anomalies on a single data domain and lack transferability. They\ntypically require retraining or fine-tuning when encountering new, unseen classes.\n\n2.2. Few-shot and Generalist Anomaly Detection\n\n43094\n\nFew-Shot Anomaly Detection (FSAD) [14, 15, 23, 31] aims\nto identify anomalies using only a limited number of normal samples from a target dataset. FSAD methods can\nbe broadly split into two groups: training-free and metalearning-based methods. Training-free methods, such as\nFastRecon [14] and UniVAD [17], are often adapted from\nembedding-based approaches. They use the few-shot normal samples to construct a reference memory bank or calculate distance-based anomaly scores without any network\n\n\fResidual Patch\nFeatures\n\nQuery\n\nComputing\nResidual\n\nSupport Set\n\nFeature Extraction\n\nResidual Feature Learning\nResidual\nProxies\n\n…\n\nNN\n\nSupport Patch\nFeatures\n\nNormality Learning from Support\nNormality\nProxies\n\nSelf-Attention\n\nCross-Attention\n\nRG-Attention\n\nLearnable\nProxies\n\n…\n\nResidual\nEmbeddings\n\n…\n\nResidual\nProxies\n\nNLS\n\n…\n\nNormality Proxies\n\n…\n\nResidual\nEmbeddings\n\nNormality\nActivation\n\nHNQ\n\nPixel-level Label\n\nHunting Normality within Query\n\n…\n\nSelf-Attention\n\n…\n\n…\n\nResidual Proxies\n\nQuery Patch\nFeatures\n\n…\n\nRFL\n\n…\n…\n…\n\nNormality\nProxies\n\nQuery Patch\nFeatures\n\nNormality\nActivation\n\nComputing Residual\n\n…\n\nSupport\nEmbeddings\n\nNN\n\nQuery\nEmbeddings\n\nSupport\nNN\nEmbedding Bank Results\n\nResidual\nEmbeddings\n\nPrediction\n\nForward\n\nFrozen\nEncoder\n\nLearnable\nModule\n\nElement-wise\nsummation\nSimilarity\nComputation\n\nOptimization\n\nFigure 2. Overview of training phase of our framework. Given a query sample xq and its corresponding support samples {xsk }K\nk=1\n(normal), we first leverage a frozen encoder E on query and support inputs, obtaining query patch features F q and support patch features\n{Fks }K\nk=1 . Next, residual patch features R are computed by the NN search and element-wise subtraction. Subsequently, we apply several\nb in the RFL module. In the next NLS module, P\nb aims\nlearnable proxies P to capture the pattern of residual R, obtaining residual proxies P\ne that can\nto learn normality from support embeddings by comparing with residual, and the output of NLS is named as normality proxies P\nhunt potential normality from query features, achieving anomaly localization.\n\ntraining. Meta-learning-based methods [23, 29, 49] focus\non generalizing the detection ability of model to new target domains. RegAD [23] trains a registration network on\nseen categories that can then register samples from unseen\ncategories. However, RegAD remains dependent on domain relevance between training and testing data. Based\non meta-learning-based FSAD, generalist anomaly detection (GAD) [47, 56] trains one unified model on the source\ndomain that can generalize to detect anomalies in diverse,\nunseen classes from the target domain. To achieve domainagnostic anomaly detection, InCTRL [56] firstly proposes a\ngeneralist anomaly detection (GAD) task and utilizes residual distance to discriminate anomalies. Subsequently, ResAD [47] directly learning the distribution of residual features to eliminate domain dependencies to achieve GAD.\n\n3. Methodology\n3.1. Problem Statement\nGeneralist anomaly detection (GAD) [47, 56] aims to train\na unified model on a source domain, Dsource that can generalize to identify anomalies in a previously unseen target do-\n\nmain, Dtarget . Following a standard meta-learning framework, the source dataset Dsource = {X , Y} consists of N\nsamples: X = {xi }N\ni=1 , and their corresponding groundtruth (GT) masks: Y = {yi }N\ni=1 . During training, the data\ncan be divided into multiple episodes, each consisting of\na query sample xq with its GT mask yq and a support set\nq\nof K normal samples {xsk }K\nk=1 from the same class as x .\nThe model is then trained across these episodes. During inference, the trained model is evaluated on Dtarget , which\ncontains classes unseen in Dsource , using the same episodic\nstructure to locate potential anomalies in the query samples.\n\n3.2. Overview\nThe overview of our training framework is illustrated in\nFig.2. For each training episode, a query input and its corresponding support samples are first processed by a pretrained, frozen backbone network to extract patch-level features. The residual features for each query patch are then\nobtained by performing a Nearest-Neighbor (NN) search\nagainst the support set features and calculating their differences. Although the residual features help build a classinvariant feature space, they still exhibit inconsistencies\n\n43095\n\n\facross instances, which may introduce potential risks. To\nmitigate this issue, we introduce a learnable module that\nmodels and leverages normality information from the support set under the guidance of the residual features. This\nprocess is driven by two novel attention-based modules:\nResidual Feature Learning (RFL) and Normality Learning\nfrom Support (NLS). RFL utilizes a set of learnable proxies\nthat interact with residual features through cross-attention\nto capture diverse residual patterns, generating a set of\n‘residual proxies’. Next, NLS leverages the residual proxies to learn representative normality patterns from the support set features. It employs a residual-guided comparison\nto generate a query-related set of ‘normality proxies’. Finally, these generated normality proxies are used to hunt for\nnormality within the query patch features. Anomaly localization is achieved by computing the similarity between the\nquery features and the normality proxies. By training the\nframework on the source domain, the model learns a transferable relationship between residual patterns and instancelevel normality, enabling generalization to unseen target domains.\n\nwhere R ∈ RHW ×C represents the ‘difference’ between\nthe query features and the most similar normal features from\nthe support set (see Fig.3A).\n\n3.3. Feature Extraction and Residual Feature\n\nwhere ⊤ is transpose of matrix, and d is scaling factor [41].\nSince both Key and Value are derived from the residual feab contains information across the entire\ntures R, the proxy P\nresidual space and can be considered as prototypes of residual features.\n\nFollowing prior works [10, 46], Vision Transformer (ViT)\nis adopted as our feature encoder. As shown in Fig.2a, the\nfrozen encoder E with T layers first processes a query image xq and its K support images {xsk }K\nk=1 to extract the\nintermediate-layer features for both, producing query patch\nfeature F q ∈ RHW ×C and a set of support patch features\ns\nHW ×C\n{Fks }K\n. Here,\nk=1 , respectively, where each Fk ∈ R\nH and W are the spatial dimensions of the feature map,\nand C is the channel dimension. For convenience, we denote the flattened query features as F q = {flq }L\nl=1 and the\naggregated bank of all support features as F s = {fls }KL\nl=1 ,\nwhere L = H ∗ W .\nThese features are then used to compute residual features that effectively suppress class-specific information,\nthus forming a more class-invariant space suitable for GAD.\nThe residual computation is based on the NN search. For\neach query embedding f q ∈ F q , its nearest neighbor f∗s is\nidentified from the support bank F s using the cosine distance d(·, ·):\nf∗s := argmin (d(f q , f s )) .\n\n3.4. Residual Feature Learning\nAs shown in Fig.2b, the Residual Feature Learning (RFL)\nmodule is designed to capture the varied patterns within the\nresidual features R. We first initialize M learnable proxies, denoted by P ∈ RM ×C . Then, RFL employs a crossattention block, where the proxies P serve as queries to focus on the residual features R. The Query, Key, and Value\nfor the cross-attention block are defined as:\nQ1 = W1Q P, K1 = W1K R, V1 = W1V R,\n\nwhere W1Q , W1K , and W1V are learnable weights. The\noutput of this cross-attention is then passed through a selfattention module SA1 (·) to produce the final residual proxb\nies P:\n\u0013 \u0013\n\u0012\n\u0012\n⊤\n1 K1\nb = SA1 Softmax Q√\nV1 ,\n(5)\nP\nd\n\n3.5. Normality Learning from Support\nThe Normality Learning from Support (NLS) module, deb to\npicted in Fig.2c, leverages the learned residual proxies P\nactively learn normality patterns from the support set F s .\nThis is achieved through a residual-guided comparison that\ne ∈ RM ×C .\nproduces a set of normality proxies P\nThe core of NLS is a Residual-Guided Attention (RGAttention) mechanism. This is modeled as a cross-attention\nblock where the Query, Key, and Value are defined as:\n\n(1)\n\nb K2 = W2K R, V2 = W2V F¯s ,\nQ2 = W2Q P,\n(6)\nPK\n1\ns\nwhere F¯s = K\nk=1 Fk is the mean vector of the support\nfeatures. The attention weights (from Q2 KT\n2 in Eq. (6)) are\ncomputed by measuring the correlation between the residb and the residual embeddings R implicitly.\nual proxies P\nThese weights are then used to aggregate the support features (V2 ). This process enables the model to learn the correspondence between residual patterns and normality patterns from the support set, and to produce normality proxies\ne that are represented in the instance feature space. Similar\nP\nto RFL, the NLS module further refines the RG-Attention\noutput through a self-attention block SA2 (·):\n\u0013 \u0013\n\u0012\n\u0012\nQ2 K⊤\n2\ne\n√\nV2 .\n(7)\nP = SA2 Softmax\nd\n\nf s ∈F s\n\nThe residual embedding r is then defined as the difference\nbetween the embedding and its nearest neighbor (Fig.2e):\nr = f q − f∗s , r ∈ R1×1×C .\n\n(2)\n\nBy performing this operation on all query embeddings, the\nresidual patch features R = {rl }L\nl=1 are obtained, which\ncan be expressed as:\nR = F q − F∗s ,\n\n(4)\n\n(3)\n\n43096\n\n\fSample\n\nGT\n\nResidual\n\nHNQ ( )\n\nPrediction\n\n(A)\n\nOptimization Objective Our framework focuses on\ntraining a residual-based model to adaptively hunt normality information within the query input. Therefore, the\nanomaly localization result S3 of NLQ module should be\nconsistent with the GT mask yq of the query image, i.e.,\n\n(B)\n\nLlocal = Focal(S3 , yq ) + Dice(S3 , yq ),\n\n(C)\n\nwhere Focal(·) and Dice(·) are the Focal loss [32] and Dice\nloss [30], respectively. Moreover, the obtained anomaly\nclassification results should also align with image-level\nquery label y q , i.e.,\nLglobal = BCE(S3∗ , y q ),\n\n(D)\n\n(9)\n\n(10)\n\nwhere S3∗ is the maximum of prediction S3 and BCE(·) denotes BCE loss function. Finally, a unified optimization objective is adopted to train our model, according to Eq. (9)\nand (10):\nL = Lglobal + Llocal .\n(11)\n\nFigure 3. Visualization of residual patch feature and S3 . (A)\nResidual can be seen as the difference between the query and support. (B-D) However, the significant difference between query and\nsupport may not necessarily be abnormal (red regions).\n\n3.7. Inference on Target Domain\n3.6. Hunting Normality within Query\nAnomaly Localization Prediction As shown in Fig.2d,\nwe apply similarity computation between normality proxies\ne ∈ RM ×C and query patch features F q ∈ RHW ×C to get\nP\nthe normality activation map. The pixel-level similarity can\nbe written as:\nS0l =\n\nM\nem\n1 X flq · P\n,\nq\nem ∥\nM m=1 ∥fl ∥∥P\n\n(8)\n\nwhere ∥ · ∥ is L2 norm. Based on the pixel-level similarity\nvalue, a normality activation map S0 ∈ RH×W (see Fig.3)\nis achieved and an initial anomaly map S1 is then given by\nS1 = 1 − S0 . Following previous works [10, 38], a second\nanomaly score map S2 is further computed based on the\nNN distance between the query features F q and the support\nfeatures F s . The final prediction S3 is then produced by\ncombining these two maps: S3 = S1 + S2 .\nAs shown in Fig.3, residual features can sometimes be\ndirectly seen as the difference between query and support\nfeatures (A). However, the abnormal residual serves only as\na weak cue of abnormality, and the significant difference between query and support may not necessarily be an anomaly\n(B-D), which introduces potential risks. Therefore, instead\nof directly modeling the residuals, we model the relationship between residuals and instance features to mitigate the\ninconsistency between them. Furthermore, rather than focusing on the complex and diverse patterns of abnormal\nresiduals, we leverage some proxies that are learned from\nresidual and support features to hunt the normality within\nthe query (S3 in Fig.3 shows a superior normal activation).\n\nDuring inference on the target domain Dtarget , the trained\nmodel is applied using the same episodic structure. For a\ngiven test query and support set, the features are extracted,\nand residual features R are computed. The trained RFL and\nNLS modules then dynamically generate a new set of nore specific to the target samples. These proxmality proxies P\nies are used to generate the normality map S0 for the target query. The final anomaly score map S3 is computed by\ncombining S1 (from S0 ) and S2 (from NN distance), consistent with the training phase.\n\n4. Experiment\n4.1. Experimental Setup\nDatasets. We conduct experiments on three widely used\nbenchmarks: MVTec AD [1], VisA [58], and BraTS [36].\nOur evaluation includes three tasks: (1) training on VisA\nand testing on MVTec AD;(2) training on MVTec AD and\ntesting on VisA; (3) training on MVTec AD and testing on\nBraTS. The first two settings assess generalization across\ndifferent industrial domains, while the third evaluates transferability from industrial to medical applications.\nEvaluation Metrics. Following previous works [10, 25,\n47], we evaluate both image-level anomaly classification\nand pixel-level localization performance. For detection, we\nreport the Area Under the Receiver-Operator Curve (AUROC [11]), maximum F1-score at the optimal threshold\n(F1-max), and Average Precision (AP) based on imagelevel scores. For segmentation, we utilize pixel-level AUROC, F1-max, and Per-Region Overlap (PRO [1, 2]).\n\n43097\n\n\fTable 1. Comprehensive GAD results with six image-level and pixel-level metrics on MVTec AD, VisA datasets. When testing with\nMVTec AD, the training set is Visa, and vice versa. Results marked with ∗ are based on our re-implementation and other results are quoted\nfrom works[25, 31, 56]. The best/runner-up results are highlighted in bold/underline.\nMVTecAD\nMethod\n\nImage-level\n\nVisA\nPixel-level\n\nAUROC\n\nAP\n\nF1-max\n\nAUROC\n\nSPADE [7]\nPaDiM [11]\nPatchCore[38]\nWinCLIP [25]\nPromptAD [31]\nResAD∗ [47]\n\n81.0\n76.6\n83.4\n93.1\n94.6\n84.8\n\n90.6\n88.1\n92.2\n96.5\n97.1\n92.7\n\n90.3\n88.2\n90.5\n93.7\n91.2\n\n91.2\n89.3\n92.0\n95.2\n95.9\n93.4\n\nOurs\n\n96.0\n\n96.3\n\n93.1\n\n96.4\n\nPRO\n\nImage-level\nF1-max\n\nPixel-level\n\nAUROC\n\nAP\n\nF1-max\n\nAUROC\n\nPRO\n\nF1-max\n\n1-Shot (K = 1)\n83.9\n73.3\n79.7\n87.1\n87.9\n83.3\n\n42.4\n40.2\n50.4\n55.9\n48.2\n\n79.5\n88.2\n79.9\n83.8\n86.9\n80.9\n\n82.0\n62.8\n82.8\n85.1\n88.4\n83.7\n\n80.7\n75.3\n81.7\n83.1\n81.3\n\n95.6\n89.9\n95.4\n96.4\n96.7\n95.9\n\n84.1\n64.3\n80.5\n85.1\n85.1\n79.6\n\n35.5\n17.4\n38.0\n41.3\n37.8\n\n92.5\n\n52.8\n\n87.3\n\n88.5\n\n85.7\n\n97.6\n\n91.4\n\n39.9\n\n2-Shot (K = 2)\nSPADE [7]\nPaDiM [11]\nPatchCore [38]\nWinCLIP [25]\nPromptAD [31]\nInCTRL [56]\nResAD∗ [47]\n\n82.9\n78.9\n86.3\n94.4\n95.7\n94.0\n87.2\n\n91.7\n89.3\n93.8\n97.0\n97.9\n96.9\n93.9\n\n91.1\n89.2\n92.0\n94.4\n92.2\n\n92.0\n91.3\n93.3\n96.0\n96.2\n94.8\n\nOurs\n\n97.2\n\n97.9\n\n94.3\n\n96.8\n\n85.7\n78.2\n82.3\n88.4\n88.5\n85.5\n\n44.5\n43.7\n53.0\n58.4\n50.2\n\n80.7\n67.4\n81.6\n84.6\n88.3\n85.8\n86.6\n\n82.3\n71.6\n84.8\n85.8\n90.0\n87.7\n88.3\n\n81.7\n75.7\n82.5\n83.0\n84.1\n\n96.2\n92.0\n96.1\n96.8\n97.1\n96.5\n\n85.7\n70.1\n82.6\n86.2\n85.8\n82.3\n\n40.5\n21.1\n41.0\n43.5\n40.0\n\n92.6\n\n53.3\n\n88.0\n\n89.1\n\n85.9\n\n97.6\n\n91.8\n\n41.7\n\n4-Shot (K = 4)\nSPADE [7]\nPaDiM [11]\nPatchCore [38]\nWinCLIP [25]\nPromptAD [31]\nInCTRL [56]\nResAD∗ [47]\n\n84.8\n80.4\n88.8\n95.2\n96.6\n94.5\n90.7\n\n92.5\n90.5\n94.5\n97.3\n98.5\n97.2\n95.7\n\n91.5\n90.2\n92.6\n94.7\n93.9\n\n92.7\n92.6\n94.3\n96.2\n96.5\n95.8\n\n87.0\n81.3\n84.3\n89.0\n90.5\n88.7\n\n46.2\n46.1\n55.0\n59.5\n53.0\n\n81.7\n72.8\n85.3\n87.3\n89.1\n87.7\n89.3\n\n83.4\n75.6\n87.5\n88.8\n90.8\n90.2\n90.7\n\n82.1\n78.0\n84.3\n84.2\n86.5\n\n96.6\n93.2\n96.8\n97.2\n97.4\n96.8\n\n87.3\n72.6\n84.9\n87.6\n86.2\n84.1\n\n43.6\n24.6\n43.9\n47.0\n41.6\n\nOurs\n\n97.6\n\n98.0\n\n95.1\n\n97.1\n\n92.4\n\n56.9\n\n90.3\n\n90.8\n\n87.9\n\n97.8\n\n92.0\n\n43.4\n\nImplementation Details. We employ a lightweight ViT\n(ViT-Small/14 &amp; DINOv2)[37] as the encoder to ensure low\nlatency. The encoder parameters remain frozen; only the\nproposed attention modules are updated. Optimization uses\nAdamW [33] with an initial learning rate of 1 × 10−5 , decaying by a factor of 0.1 at epochs 10 and 15. Training\nconverges within 10 epochs, with 500 episodes per epoch.\nInput images are resized to 448 × 448 without augmentation. We set the number of learnable proxies to M = 25.\nFollowing established protocols [25, 31], the number of normal references is set to K ∈ [1, 2, 4, 8]. The implementation\nis based on PyTorch, and the experiments are conducted on\na single NVIDIA RTX 3090 24GB GPU.\n\n4.2. Comparisons with SOTA Methods\n\nMVTec AD. As detailed in Table 1, our method consistently outperforms previous SOTA approaches across various few-shot settings on MVTec AD (training on VisA\ndataset). In the 4-shot scenario, we achieve superior performance with 97.6 image-level AUROC, 98.0 AP, and\n95.1 F1-max, surpassing previous methods such as PromptAD [31] and WinCLIP [25] in key metrics and showing\na superior anomaly classification performance. This advantage extends to the 1-shot setting, where our method\nachieves 96.0 image-level AUROC, significantly outperforming PromptAD [31] and ResAD [47]. Furthermore, our\npixel-level metrics, including 92.5 PRO at K = 1, demonstrate robust localization capabilities compared to the next\nbest method. Qualitative results in Fig.4a further illustrate\nour method’s ability to effectively reduce false predictions.\nVisA. Our method maintains highly competitive performance when training on MVTec AD and testing on the\nVisA dataset. In the 4-shot setting in Table 1, we achieve\n90.3 image-level AUROC, 90.8 AP, and 87.9 F1-max, outperforming ResAD [47] and WinCLIP [25] in image-level\n\nWe compare our proposed method with previous state-ofthe-art (SOTA) GAD methods on MVTec AD and VisA\ndatasets. Six different image-level and pixel-level metrics\nare used for quantitative evaluation in Table 1.\n\n43098\n\n\fSample\n\nGT\n\nPatchCore\n\nWinCLIP\n\nResAD\n\nOurs\n\nSample\n\nGT\n\nBaseline\n\nOurs\n\nSample\n\nGT\n\nBaseline\n\nOurs\n\n(b) Visualized Examples on VisA and BraTS\n\n(a) Visualized Examples on MVTec AD\n\nFigure 4. Visualization for anomaly localization results of previous methods and our framework on MVTec AD, VisA, and BraTS datasets.\n\nTable 2. Generalist anomaly detection results with image-level and\nPixel-level AUROC on BraTS datasets. Results marked with ∗ are\nbased on our re-implementation. Other results are reported from\nworks [25, 47, 56].\nShot\nK=1\n\nK=2\n\nK=4\n\nMethod\n\nImage\n\nPixel\n\nMean\n\n∗\n\nResAD [47]\n\n73.5\n\n91.0\n\n82.3\n\nOurs\n\n78.1\n\n96.5\n\n87.3\n\nSPADE [7]\nPaDiM [11]\nPatchCore [38]\nRegAD [23]\nWinCLIP [25]\nInCTRL [56]\nResAD∗ [47]\n\n58.0\n59.4\n58.2\n54.6\n55.9\n74.6\n66.2\n\n92.8\n90.2\n93.5\n81.4\n91.5\n91.5\n\n75.4\n74.8\n75.9\n68.0\n73.7\n78.9\n\nOurs\n\n82.0\n\n96.5\n\n89.2\n\nSPADE [7]\nPaDiM [11]\nPatchCore [38]\nRegAD [23]\nWinCLIP [25]\nMVFA∗ [24]\nInCTRL [56]\nResAD∗ [47]\n\n66.3\n60.6\n71.2\n60.0\n67.3\n75.2\n76.9\n74.9\n\n94.8\n94.5\n95.9\n87.3\n93.2\n92.7\n94.3\n\n80.6\n77.6\n83.6\n73.7\n80.3\n84.0\n84.6\n\nOurs\n\n85.4\n\n97.6\n\n91.5\n\nsults confirm the superior performance of our framework to\ngeneralize and identify anomalies in diverse target domains.\nVisualization examples for VisA are provided in Fig.4b.\nBraTS. To evaluate robust transferability, we trained on\nthe industrial MVTec AD dataset and tested on the medical\nBraTS dataset. As shown in Table 2, our method achieves\nsuperior performance across all few-shot settings. In the 1shot scenario, we obtain a mean performance of 87.3, significantly surpassing ResAD [47]. This advantage is amplified in the 4-shot setting, where we achieve an image-level\nAUROC of 85.4 and a pixel-level AUROC of 97.6, substantially outperforming ResAD [47] and WinCLIP [25]. These\nresults demonstrate robust transferability from industrial to\nmedical imaging domains. Visualization of anomaly localization can be found in Fig.4b.\nEfficiency Comparison. As shown in Table 3, compared to\nprevious methods [47, 56], our method outperforms them\non three efficiency metrics. Unlike ResAD [47], which\nspends a lot of training time on fitting the normal residual distribution, the learnable parameters of our framework\nonly involve two attention modules, significantly reducing training time. InCTRL [56] involves modal alignment\nlearning (text-visual), and the entire framework adopts multiple mappings between text and visual spaces, which requires more parameters and also leads to a significant decrease in inference speed.\n\n4.3. Ablation Study\nIn this section, we investigate the contributions of the main\ncomponents and the impact of different settings on the proposed RFL and NLS modules.\n\nmetrics. These gains are also evident in the 1-shot setting,\nwhere we achieve 87.3 image-level AUROC and 88.5 AP,\noutperforming PromptAD [31] and ResAD [47]. These re-\n\n43099\n\n\fTable 5. Ablation study of our method on VisA. RFL: residual\nfeature learning. NLS: normality learning from support.\n\nTable 3. Efficiency comparison between our method and previous\nworks on MVTec AD. Total parameters, FPS, and training time\nare reported in this table.\nMethod\n\nTotal\nParameters (M)\n\nTraining\nTime (H)\n\nInference\nSpeed (FPS)\n\nInCTRL\nResAD\n\n117.5\n59.2\n\n0.7\n20.6\n\n1.2\n7.8\n\nOurs\n\n24.4\n\n0.5\n\n15.8\n\nRFL\n\nNLS\n\nI-AUROC\n\nP-AUROC\n\nA\nB\nC\nD\n\n–\n✓\n–\n✓\n\n–\n–\n✓\n✓\n\n93.2\n90.4\n93.8\n96.0\n\n94.5\n91.6\n95.2\n96.4\n\nRFL\n\nNLS\n\nI-AUROC\n\nP-AUROC\n\nA\nB\nC\nD\n\n–\n✓\n–\n✓\n\n–\n–\n✓\n✓\n\n82.3\n80.1\n83.7\n87.3\n\n95.5\n93.2\n96.2\n97.6\n\nTable 6. The impact of different Query, Key, Value in RFL and\nNLS modules. All experiments are conducted on MVTec AD, and\nimage-level and pixel-level AUROC are reported.\n\nTable 4. Ablation study of our method on MVTec AD. RFL: residual feature learning. NLS: normality learning from support.\nVariant\n\nVariant\n\ni\nii\niii\niv\n\nEffectiveness of Main Components. Table 4 and 5\ndemonstrate the performances of four model variants on\nMVTec AD and VisA datasets, respectively: A. Our baseline model only adopts the NN algorithm to generate S2 as\nthe final anomaly score; B. A RFL-only variant leverages\nb to hunt normality within the query directly, i.e., P\nem in\nP\nb\nEq.(8) is replaced by Pm . C. A NLS-only variant adopts\ninitialized P as Query in Eq.(6). D. Our entire framework\nconsists of RFL and NLS modules. The baseline model\n(Variant A) achieves 93.2 and 82.3 image-level AUROC\non MVTec AD and VisA, respectively. Interestingly, employing only the RFL module (Variant B) to directly hunt\nfor normality results in a performance drop compared to\nthe baseline. This confirms our early hypothesis that directly utilizing residual features or their proxies is risky\ndue to the inconsistency between residuals and instance features. Conversely, the NLS-only model (Variant C) brings\nmoderate improvements over the baseline. This is because\nrandomly initialized proxies can also learn some normality\nunder supervised training, even without residual guidance.\nHowever, the most significant performance gains are observed when both modules are integrated (Variant D). This\ndemonstrates that RFL effectively captures diverse residual\npatterns, which then serve as necessary guidance for NLS\nto accurately learn instance-level normality, validating the\nsynergy between these two components.\nImpact of Different Settings in RFL and NLS. We further explore the impact of different Query, Key, and Value\nassignments within our attention modules, as detailed in Table 6. The default configuration (Row i), where RFL uses\nlearnable proxies P to query residuals R, and NLS uses\nb to query residuals R while\nthe resulting residual proxies P\n\nQ1\n\nK1\n\nV1\n\nQ2\n\nK2\n\nV2\n\nI\n\nP\n\nP\nP\nP\nP\n\nR\nR\nF¯s\n\nR\nF¯s\nR\nR\n\nb\nP\nb\nP\nb\nP\nb\nP\n\nR\nF¯s\nR\nF¯s\n\nF¯s\nR\nF¯s\nF¯s\n\n96.0\n92.7\n95.5\n94.4\n\n96.4\n93.9\n96.1\n95.9\n\nR\n\naggregating support features F¯s , achieves the best performance. Modifying these settings leads to noticeable performance degradation. Variant ii mainly modifies the NLS\nmodule by setting its V2 to R instead of the mean support\nfeatures. This results in a significant performance drop to\n92.7 and 93.9. This confirms our hypothesis that the NLS\nmodule must learn normality patterns by aggregating information from the instance-level support features rather than\nfrom the residual space. As shown in Variant iii, we replace\nR with (F¯s ) for K1 in RFL, which may interfere with the\nlearning of residual patterns, degrading performance. Variant iv modifies the NLS module by changing its K2 to F¯s ,\nwhere normal instance pattern learning is no longer guided\nby residuals, declining performance.\n\n5. Conclusion\nIn this paper, we addressed the challenges of Generalist\nAnomaly Detection (GAD), specifically identifying the significant risks associated with directly modeling residual feature distributions due to their inconsistency with instance\nfeatures. To mitigate these risks, we proposed a novel\nframework that re-purposes residuals as guidance to learn\ninstance-level normality patterns from the support set. Our\napproach mainly consists of two modules: Residual Feature\nLearning (RFL), which captures diverse patterns from residual features, and Normality Learning from Support (NLS),\nwhich leverages these patterns to generate dynamic normality proxies. By employing these proxies to hunt for normality within query samples, our method achieves robust generalization to new domains. Comprehensive experiments\non GAD benchmarks demonstrate that our method achieves\ncompetitive performance across various few-shot settings.\n\n43100\n\n\f6. Acknowledgments\nThis work was supported by the National Natural Science Foundation of China (No.\n62471405,\n62331003, 62301451), Basic Research Program of\nJiangsu (BK20241814), Suzhou Basic Research Program (SYG202316) and XJTLU REF-22-01-010.\n\n[15] Bin-Bin Gao. Learning to detect multi-class anomalies with\njust one normal image prompt. In ECCV, 2024. 2\n[16] Zhaopeng Gu, Bingke Zhu, Guibo Zhu, Yingying Chen,\nMing Tang, and Jinqiao Wang. AnomalyGPT: Detecting industrial anomalies using large vision-language models. In\nAAAI, 2024. 2\n[17] Zhaopeng Gu, Bingke Zhu, Guibo Zhu, Yingying Chen,\nMing Tang, and Jinqiao Wang. Univad: A training-free unified model for few-shot visual anomaly detection. In CVPR,\n2025. 2\n[18] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka.\nCFLOW-AD: Real-time unsupervised anomaly detection\nwith localization via conditional normalizing flows. In\nWACV, 2022. 1\n[19] Jia Guo, Shuai Lu, Lize Jia, Weihang Zhang, and Huiqi\nLi. Recontrast: Domain-specific anomaly detection via contrastive reconstruction. In NeurIPS, 2023. 2\n[20] Jia Guo, Shuai Lu, Weihang Zhang, Fang Chen, Huiqi Li,\nand Hongen Liao. Dinomaly: The less is more philosophy\nin multi-class unsupervised anomaly detection. In CVPR,\n2025.\n[21] Haoyang He, Jiangning Zhang, Hongxu Chen, Xuhai Chen,\nZhishan Li, Xu Chen, Yabiao Wang, Chengjie Wang, and Lei\nXie. A diffusion-based framework for multi-class anomaly\ndetection. In AAAI, 2024. 2\n[22] Kelei He, Chen Gan, Zhuoyuan Li, Islem Rekik, Zihao Yin,\nWen Ji, Yang Gao, Qian Wang, Junfeng Zhang, and Dinggang Shen. Transformers in medical image analysis. Intelligent Medicine, 3(1):59–78, 2023. 1\n[23] Chaoqin Huang, Haoyan Guan, Aofan Jiang, Ya Zhang,\nMichael Spratling, and Yan-Feng Wang. Registration based\nfew-shot anomaly detection. In ECCV, pages 303–319,\n2022. 2, 3, 7\n[24] Chaoqin Huang, Aofan Jiang, Jinghao Feng, Ya Zhang, Xinchao Wang, and Yanfeng Wang. Adapting visual-language\nmodels for generalizable anomaly detection in medical images. In CVPR, 2024. 7\n[25] Jongheon Jeong, Yang Zou, Taewan Kim, Dongqing Zhang,\nAvinash Ravichandran, and Onkar Dabeer. WinCLIP:\nZero-/few-shot anomaly classification and segmentation. In\nCVPR, 2023. 5, 6, 7\n[26] Xi Jiang, Jianlin Liu, Jinbao Wang, Qiang Nie, Kai Wu,\nYong Liu, Chengjie Wang, and Feng Zheng. SoftPatch: Unsupervised anomaly detection with noisy data. In NeurIPS,\n2022. 2\n[27] Mingyu Lee and Jongwon Choi. Text-guided variational image generation for industrial anomaly detection and segmentation. In CVPR, 2024. 2\n[28] Jiarui Lei, Xiaobo Hu, Yue Wang, and Dong Liu. PyramidFlow: High-resolution defect contrastive localization using\npyramid normalizing flow. In CVPR, 2023. 2\n[29] Wenqiao Li, Xiaohao Xu, Yao Gu, Bozhong Zheng,\nShenghua Gao, and Yingna Wu. Towards scalable 3d\nanomaly detection and localization: A benchmark via 3d\nanomaly synthesis and a self-supervised learning network.\nIn CVPR, 2024. 2, 3\n\nReferences\n[1] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. MVTec AD – a comprehensive real-world\ndataset for unsupervised anomaly detection. In CVPR, 2019.\n5\n[2] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. Uninformed students: Student-teacher\nanomaly detection with discriminative latent embeddings. In\nCVPR, 2020. 5\n[3] Tri Cao, Jiawen Zhu, and Guansong Pang. Anomaly detection under distribution shift. In ICCV, 2023. 2\n[4] Yunkang Cao, Jiangning Zhang, Luca Frittoli, Yuqi Cheng,\nWeiming Shen, and Giacomo Boracchi. AdaCLIP: Adapting\nCLIP with hybrid learnable prompts for zero-shot anomaly\ndetection. In ECCV, 2024. 2\n[5] Qiyu Chen, Huiyuan Luo, Chengkan Lv, and Zhengtao\nZhang. A unified anomaly synthesis strategy with gradient ascent for industrial anomaly detection and localization.\nECCV, 2024. 2\n[6] Yuanhong Chen, Yu Tian, Guansong Pang, and Gustavo\nCarneiro. Deep one-class classification via interpolated\ngaussian descriptor. In AAAI, 2022. 2\n[7] Niv Cohen and Yedid Hoshen. Sub-image anomaly detection\nwith deep pyramid correspondences. ArXiv, abs/2005.02357,\n2020. 6, 7\n[8] Alex Costanzino, Pierluigi Zama Ramirez, Giuseppe Lisanti,\nand Luigi Di Stefano. Multimodal industrial anomaly detection by crossmodal feature mapping. In CVPR, 2024. 2\n[9] Zhewei Dai, Shilei Zeng, Haotian Liu, Xurui Li, Feng Xue,\nand Yu Zhou. Seas: few-shot industrial anomaly image generation with separation and sharing fine-tuning. In ICCV,\n2025. 2\n[10] Simon Damm, Mike Laszkiewicz, Johannes Lederer, and\nAsja Fischer. AnomalyDINO: Boosting patch-based fewshot anomaly detection with dinov2. arXiv, 2024. 4, 5\n[11] Thomas Defard, Aleksandr Setkov, Angelique Loesch, and\nRomaric Audigier. PaDiM: A patch distribution modeling\nframework for anomaly detection and localization. In ICPR,\n2021. 1, 5, 6, 7\n[12] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse\ndistillation from one-class embedding. In CVPR, 2022. 1\n[13] Choubo Ding, Guansong Pang, and Chunhua Shen. Catching\nboth gray and black swans: Open-set supervised anomaly\ndetection. In CVPR, 2022. 1, 2\n[14] Zheng Fang, Xiaoyang Wang, Haocheng Li, Jiejie Liu, Qiugui Hu, and Jimin Xiao. FastRecon: Few-shot industrial\nanomaly detection via fast feature reconstruction. In ICCV,\n2023. 2\n\n43101\n\n\funsupervised multi-class anomaly detection. In AAAI, 2025.\n2\n[44] Xiaolei Wang, Xiaoyang Wang, Huihui Bai, Eng Gee Lim,\nand Jimin Xiao. Decad: Decoupling anomalies in latent\nspace for multi-class unsupervised anomaly detection. In\nICCV, 2025. 1, 2\n[45] Xiaolei Wang, Xiaoyang Wang, Huihui Bai, Eng Gee Lim,\nand Jimin Xiao. Icc: Intra-cluster contraction for pedestrian anomaly detection under one-class classification setting. IEEE Transactions on Artificial Intelligence, 2025. 2\n[46] Yuexin Wang, Xiaolei Wang, Yizheng Gong, and Jimin Xiao.\nNormal-abnormal guided generalist anomaly detection. In\nNeurIPS, 2025. 4\n[47] Xincheng Yao, Zixin Chen, Chao Gao, Guangtao Zhai, and\nChongyang Zhang. ResAD: A simple framework for class\ngeneralizable anomaly detection. In NeurIPS, 2024. 1, 3, 5,\n6, 7\n[48] Xincheng Yao, Yan Luo, Zefeng Qian, and Chongyang\nZhang. Adpretrain: Advancing industrial anomaly detection\nvia anomaly representation pretraining. In NeurIPS, 2025. 2\n[49] Xincheng Yao, Chao Shi, Muming Zhao, Guangtao Zhai,\nand Chongyang Zhang. Resad++: Towards class agnostic anomaly detection via residual feature learning. arXiv\npreprint arXiv:2509.23741, 2025. 3\n[50] Jihun Yi and Sungroh Yoon. Patch SVDD: Patch-level\nSVDD for anomaly detection and segmentation. In ACCV,\n2020. 2\n[51] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu,\nYu Zheng, and Xinyi Le. A unified model for multi-class\nanomaly detection. In NeurIPS, 2022. 1\n[52] Jiawei Yu, Ye Zheng, Xiang Wang, Wei Li, Yushuang Wu,\nRui Zhao, and Liwei Wu. FastFlow: Unsupervised anomaly\ndetection and localization via 2d normalizing flows. arXiv\npreprint arXiv:2111.07677, 2021. 1\n[53] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj.\nDRAEM-a discriminatively trained reconstruction embedding for surface anomaly detection. In ICCV, 2021. 2\n[54] Qiyin Zhong, Xianglin Qiu, Xiaolei Wang, Zhen Zhang,\nGang Liu, and Jimin Xiao. Famrd: Frequency-aware multimodal reverse distillation for industrial anomaly detection.\nIn ACM MM, 2025. 2\n[55] Qihang Zhou, Guansong Pang, Yu Tian, Shibo He, and Jiming Chen. AnomalyCLIP: Object-agnostic prompt learning\nfor zero-shot anomaly detection. In ICLR, 2024. 2\n[56] Jiawen Zhu and Guansong Pang. Toward generalist anomaly\ndetection via in-context residual learning with few-shot sample prompts. In CVPR, 2024. 1, 3, 6, 7\n[57] Jiawen Zhu, Choubo Ding, Yu Tian, and Guansong Pang.\nAnomaly heterogeneity learning for open-set supervised\nanomaly detection. In CVPR, 2024. 2\n[58] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang,\nand Onkar Dabeer. Spot-the-difference self-supervised pretraining for anomaly detection and segmentation. In ECCV,\n2022. 5\n\n[30] Xiaoya Li, Xiaofei Sun, Yuxian Meng, Junjun Liang, Fei\nWu, and Jiwei Li. Dice loss for data-imbalanced nlp tasks.\nIn ACL, 2020. 5\n[31] Xiaofan Li, Zhizhong Zhang, Xin Tan, Chengwei Chen,\nYanyun Qu, Yuan Xie, and Lizhuang Ma. PromptAD: Learning prompts with only normal samples for few-shot anomaly\ndetection. In CVPR, 2024. 2, 6, 7\n[32] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and\nPiotr Dollár. Focal loss for dense object detection. In ICCV,\n2017. 5\n[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay\nregularization. In ICLR, 2019. 6\n[34] Wei Luo, Yunkang Cao, Haiming Yao, Xiaotian Zhang,\nJianan Lou, Yuqi Cheng, Weiming Shen, and Wenyong Yu.\nExploring intrinsic normal prototypes within a single image\nfor universal anomaly detection. In CVPR, 2025. 2\n[35] Wenxin Ma, Xu Zhang, Qingsong Yao, Fenghe Tang,\nChenxu Wu, Yingtai Li, Rui Yan, Zihang Jiang, and S Kevin\nZhou. Aa-clip: Enhancing zero-shot anomaly detection via\nanomaly-aware clip. In CVPR, 2025. 2\n[36] Bjoern H Menze, Andras Jakab, Stefan Bauer, Jayashree\nKalpathy-Cramer, Keyvan Farahani, Justin Kirby, Yuliya\nBurren, Nicole Porz, Johannes Slotboom, Roland Wiest,\net al. The multimodal brain tumor image segmentation\nbenchmark (brats). IEEE transactions on medical imaging,\n34(10):1993–2024, 2014. 5\n[37] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy V.\nVo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez,\nDaniel HAZIZA, Francisco Massa, Alaaeldin El-Nouby,\nMido Assran, Nicolas Ballas, Wojciech Galuba, Russell\nHowes, Po-Yao Huang, Shang-Wen Li, Ishan Misra, Michael\nRabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINOv2: Learning robust visual features\nwithout supervision. Transactions on Machine Learning Research, 2024. 6\n[38] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard\nSchölkopf, Thomas Brox, and Peter Gehler. Towards total\nrecall in industrial anomaly detection. In CVPR, 2022. 1, 2,\n5, 6, 7\n[39] Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas\nDeecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Müller, and Marius Kloft. Deep one-class classification. In ICML, 2018. 2\n[40] Tran Dinh Tien, Anh Tuan Nguyen, Nguyen Hoang Tran,\nTa Duc Huy, Soan Duong, Chanh D Tr Nguyen, and\nSteven QH Truong. Revisiting reverse distillation for\nanomaly detection. In CVPR, 2023. 2\n[41] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia\nPolosukhin. Attention is all you need. In NeurIPS, 2017. 4\n[42] Xiaolei Wang, Tianhong Dai, Huihui Bai, Yao Zhao, and\nJimin Xiao. Unifying reconstruction and density estimation\nvia invertible contraction mapping in one-class classification.\nIn NeurIPS, 2025. 2\n[43] Xiaolei Wang, Xiaoyang Wang, Huihui Bai, Eng Gee Lim,\nand Jimin Xiao. Cnc: Cross-modal normality constraint for\n\n43102\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"