"<!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>arXiv:2510.21935v2 [cs.LG] 23 Jan 2026\n\nAutoSciDACT: Automated Scientific Discovery\nthrough Contrastive Embedding and Hypothesis\nTesting\n\nSamuel Bright-Thonney1,2 Christina Reissel1 Gaia Grosso1,2 Nathaniel Woodward1,3\nKatya Govorkova1 Andrzej Novak1 Sang Eon Park1 Eric Moreno1 Philip Harris1,2\n1\nDepartment of Physics, Massachusetts Institute of Technology\n2\nThe NSF AI Institute for Artificial Intelligence and Fundamental Interactions\n3\nDepartment of Physics, University of Wisconsin, Madison\n\nAbstract\nNovelty detection in large scientific datasets faces two key challenges: the noisy\nand high-dimensional nature of experimental data, and the necessity of making\nstatistically robust statements about any observed outliers. While there is a wealth\nof literature on anomaly detection via dimensionality reduction, most methods do\nnot produce outputs compatible with quantifiable claims of scientific discovery. In\nthis work we directly address these challenges, presenting the first step towards a\nunified pipeline for novelty detection adapted for the rigorous statistical demands\nof science. We introduce AutoSciDACT (Automated Scientific Discovery with\nAnomalous Contrastive Testing), a general-purpose pipeline for detecting novelty in\nscientific data. AutoSciDACT begins by creating expressive low-dimensional data\nrepresentations using a contrastive pre-training, leveraging the abundance of highquality simulated data in many scientific domains alongside expertise that can guide\nprincipled data augmentation strategies. These compact embeddings then enable\nan extremely sensitive machine learning-based two-sample test using the New\nPhysics Learning Machine (NPLM) framework, which identifies and statistically\nquantifies deviations in observed data relative to a reference distribution (null\nhypothesis). We perform experiments across a range of astronomical, physical,\nbiological, image, and synthetic datasets, demonstrating strong sensitivity to small\ninjections of anomalous data across all domains.\n\n1\n\nIntroduction\n\nScientific discovery is often characterized by serendipity: an unexpected observation turns out\nto have a profound impact on a field, leading to rapid progress or discovery. Today’s data-rich\nscientific landscape is potentially brimming with curious or unexplained observations, but the scale\nand complexity of available data increasingly obscures genuine novelties behind statistical noise\nor incidental fluctuations. As scientific datasets continue to grow, so too grows the challenge of\nuncovering meaningful unexplained phenomena.\nThe scientific method traditionally provides a structured framework for discovery, encompassing\nobservation, inquiry, research, hypothesis formulation, experimentation, and conclusion (top row of\nFig. 1). Effective implementation of this method relies on human intuition and domain expertise to\nidentify relevant observables and devise meaningful experiments. However, given the magnitude of\nmodern datasets, the process would significantly benefit from automated tools to efficiently identify\nthe most promising regions for discovery.\n39th Conference on Neural Information Processing Systems (NeurIPS 2025).\n\n\fFigure 1: Illustration of the scientific method (top row) and the AutoSciDACT pipeline (bottom row),\nemphasizing the corresponding methodological steps implemented within AutoSciDACT.\n\nTo address this challenge, it is essential to develop methods that intelligently prioritize informative\nregions—areas where genuine scientific surprises are most likely to emerge. Traditional featureengineering approaches are human-driven and domain-specific, limiting scalability and generalizability. Recent advances utilizing agentic AI systems and large language models can partially automate\naspects of scientific inquiry [1–3], yet still lack integrated frameworks capable of rigorous, automated\nhypothesis testing and validation.\nWe introduce AutoSciDACT (Automated Scientific Discovery with Anomalous Contrastive Testing),\na pipeline that parallels the scientific method and streamlines scientific inquiry by automating key\nsteps of the scientific discovery process. AutoSciDACT streamlines the phases of data reduction,\nhypothesis formulation, and statistical testing (bottom row of Fig. 1) by deploying contrastive learning\ntogether with the New Physics Learning Machine (NPLM) [4]. Contrastive learning is used to reduce\nraw, high-dimensional datasets into expressive low-dimensional feature embeddings while NPLM\nprovides a statistically robust mechanism for identifying and quantifying novel structures within this\nlearned embedding space. A key insight with AutoSciDACT is the effective, automated incorporation\nof domain expertise as a tool to reduce the dimensionality to a small number of well-behaved features,\nmaking it possible to construct a robust statistical model. Using NPLM, our pipeline systematically\ncompares incoming data with reference distributions of known (background) data, finding the most\nanomalous regions and quantifying their statistical significance.\nWe validate our approach using synthetic benchmarks and real-world datasets from astronomy, physics\nand biomedical domains. AutoSciDACT reliably detects meaningful novelties while remaining robust\nagainst spurious variations. Our results demonstrate the promise of combining structured contrastive\nlearning methods with automated statistical hypothesis testing to accelerate scientific discoveries.\nContributions Our main contributions can be summarized as follows:\n• An end-to-end pipeline for novelty discovery in scientific datasets that is readily transferable\nacross domains.\n• A principled procedure for incorporating scientific simulations, hand-labeled data, and\nexpert knowledge into a contrastive dimensionality reduction pipeline.\n• A statistically rigorous framework for quantifying the significance of observed anomalies,\nbeyond simply flagging anomalous datapoints.\n• A realistic demonstration of novelty detection in four disparate scientific domains.\n\n2\n\n\f2\n\nRelated Work\n\nContrastive Learning Contrastive learning is a powerful tool for learning expressive, lowdimensional data representations. Self-supervised methods such as SimCLR [5], MoCo [6], VICReg [7], and Barlow Twins [8] use data augmentations (e.g., blurring, cropping) to promote\nsemantically meaningful and well-separated embeddings. Supervised contrastive learning [9] uses\nclass labels to define positive pairs, more efficiently capturing semantic relationships between datapoints but requiring labeled datasets to train. Its applications have expanded to structured data [10],\nmultimodal inputs [11], and domain-specific tasks [12], demonstrating broad utility.\nContrastive Anomaly Detection Several existing methods leverage contrastive embeddings to\nsearch for out-of-distribution (OOD) data, but primarily focus on identifying individual anomalous\ninstances for e.g. industrial applications. In contrast, AutoSciDACT (our method) is tailored for\nscientific contexts and makes statistical statements about the presence of anomalous data, identifying\ndistribution-level deviations relative to a baseline expectation (null hypothesis). Existing approaches\ninclude Refs. [13–21], all of which rely primarily on the AUROC for identifying OOD points as\na figure of merit. They do not attempt to statistically quantify observations of OOD data, as is\nrequired in the scientific context. CADet [13] is nearest to our setup in using a two-sample test, but\nfocuses again on AUROC. In scientific contexts, various combinations of contrastive learning and\nanomaly detection have been used for domain-specific applications – e.g. in astronomy [22, 23],\nhistology, [24, 25] and particle physics [26, 27] – but, to our knowledge, no unified approaches have\nbeen proposed.\nHypothesis Testing for Anomaly Detection Traditional goodness-of-fit (GOF) tests are powerful in\nunivariate settings but struggle beyond that due to the curse of dimensionality. Simple multivariate\nextensions have limiting factors. The Mahalanobis distance-based test [28], for instance, assumes\nGaussianity and is sensitive to the choice of covariance estimation, limiting its applicability in\ncomplex data regimes. Recent machine learning-based methods have introduced model-agnostic, datadriven alternatives to enable non-parametric, highly adaptable high-dimensional tests. To quantify\ndistributional differences, Maximum Mean Discrepancy (MMD) [29–31] embeds distributions into a\nreproducing kernel Hilbert space, while the Classifier Two-Sample Test (C2ST) [32] uses a trained\nclassifier’s accuracy. Other methods include density-ratio estimation [33] and generative modeling\nframeworks that assess sample likelihoods [34]. In this work, we draw from statistical anomaly\ndetection tests developed for high-energy physics, where sensitivity to subtle deviations is crucial.\nAutoencoders [35–46] and semi-supervised binary classifiers [47] have been widely used to score\nanomalies, but not statistically test them. The NPLM algorithm [48, 49] was introduced as an end-toend score-and-test tool, outperforming classic GOF and classifier-based tests [50], showing sensitivity\nto a wide class of anomalies, and allowing incorporation of systematic (epistemic) uncertainties [51].\n\n3\n\nThe AutoSciDACT Pipeline\n\nThe AutoSciDACT pipeline consists of two phases: pre-training and discovery. The aim of the\npre-training phase is to learn an expressive, low-dimensional representation of a scientific dataset that\nretains key semantic features while reducing potentially hundreds or thousands of input dimensions\nto a handful. The discovery phase uses these embeddings in the NPLM anomaly detection and\nhypothesis testing framework to search for novelty in a scientific dataset. AutoSciDACT is designed\nfor discovering statistically significant anomalies, prioritizing detection of distributional shifts (e.g.\noverdensities, distortions, outlier clusters) with respect to a background-only hypothesis, rather\nthan instance-level anomalies. The power of NPLM (and any statistical test) degrades with data\ndimensionality, quickly requiring prohibitively large sample sizes to make statistically significant\nobservations of small signals. As such, the reduction in the pre-training phase is critical. The bottom\nrow of Fig. 1 summarizes the key steps and features of AutoSciDACT.\n3.1\n\nPre-Training: Contrastive Embeddings\n\nThe backbone of our pipeline is an encoder fθ : X → Rd trained with contrastive learning to map raw\ndata from its high-dimensional input space X to a low-dimensional representation in Rd . Contrastive\nobjectives are designed to maximize alignment between like inputs (positive pairs) while separating\nunlike inputs (negative pairs) in the learned space. We use the SimCLR framework [5], which trains\n3\n\n\fan encoder fθ alongside a projection head gϕ (typically a small MLP) with the following contrastive\nloss:\nX\nexp(sim(zi , z̃i )/τ )\nLSimCLR = −\nlog P\n,\n(1)\nj̸=i exp(sim(zi , zj )/τ )\ni∈B\n\nwhere z = gϕ (fθ (x)), (zi , z̃i ) are a positive pair, sim(·, ·) is the cosine similarity, τ is a configurable\ntemperature, and the sum in the denominator runs over all other pairings in a batch B. Traditionally,\npositive pairs (xi , x̃i ) are constructed on-the-fly from inputs xi ∈ B using random augmentations\nthat preserve semantic meaning. The projection head gϕ is discarded after training, with embeddings\nh = fθ (x) used for downstream tasks.\nIn AutoSciDACT we use supervised contrastive learning (SupCon) [9], which leverages labeled\ntraining data to create positive pairs from the same class and negative pairs from different classes.\nThe training objective is a simple generalization of the SimCLR loss:\nLSupCon = −\n\nX\ni∈B\n\nX\n1\nexp(sim(zi , zp )/τ )\nlog P\n,\n|P (i)|\nj̸=i exp(sim(zi , zj )/τ )\n\n(2)\n\np∈P (i)\n\nwhere P (i) is the set of all positive (same-class) pairs of input i in the batch. Using labels to\ndefine P (i) encodes a much richer notion of similarity from the full spectrum of a given input class,\nrather than having to indirectly learn (or fail to learn) important features from views of individual\ninputs. This also avoids the ill-defined question of identifying the \"best\" augmentations that promote\nexpressive learned features. Practitioners in many scientific domains have ready access to large\nquantities of labeled training data from high-quality simulations or expert-labeled databases, so\nrequiring labels is not often a significant bottleneck. When augmentations are desirable to encourage\nlearning scientifically relevant meta-features (e.g. Lorentz invariance for particle physics datasets), or\nif class labels are unavailable, SupCon can easily incorporate augmented views in the positive set\nP (i). In conjunction with labels, this offers a way to inject additional scientific domain knowledge\nvia tailored augmentations.\nIn addition to the contrastive objective LSupCon we include an optional supervised cross-entropy loss\nLCE , which we found beneficial for learning embeddings with a more regular structure and class\nseparation. Our full loss function is thus\nL = LSupCon + λCE LCE ,\n\n(3)\n\nwhere λCE ∼ 0.1 - 0.5 is set to make the classification objective sub-dominant.\n3.2\n\nDiscovery: Anomaly Detection &amp; Hypothesis Testing\n\nIn the discovery phase we use the embedding fθ to process unseen datasets and search for anomalous\nclusters, overdensities, or outliers in the low-dimensional space. The search process is a classic\nscientific hypothesis test: a reference dataset R composed of known backgrounds is compared to an\nobserved dataset D of unknown composition, and we seek to accept or reject the null hypothesis\nthat R and D are identically distributed (i.e. there are no new phenomena in the observed data).\nWe implement this test with NPLM, which in conjunction with the expressive learned embeddings\nenables extraordinary sensitivity to new signals.\nThe NPLM algorithm NPLM builds on the classical likelihood ratio test introduced by Neyman\net al. [52], using a test statistic defined as:\nt(D) = 2 max\nw\n\nX\nx∈D\n\nlog\n\nL(x|Hw )\n.\nL(x|H0 )\n\n(4)\n\nA trainable model fw (x) parametrizes a family of alternative hypotheses Hw with respect to the null\nH0 on inputs x ∈ Rd , with a corresponding alternative density of the form:\np(x|Hw ) = p(x|H0 ) exp[fw (x)] .\n\n(5)\n\nThis formulation enables a signal-agnostic approach: instead of specifying a particular signal model,\nthe algorithm learns the deviation directly from data by solving a maximum likelihood problem\nreframed as a machine learning task. We follow the model introduced in [4], where the problem is\n4\n\n\fsolved as a binary classification between the data of interest D, labeled y = 1, and the reference\nsample R, labeled y = 0. The model is a Nyström approximated kernel method\nfw =\n\nM\nX\n\nwi ki (x)\n\n(6)\n\ni=1\n\np\nwith M ∼ |D| + |R| Gaussian kernels ki and trainable mixture coefficients {wi ∈ R}M\ni=1 , and\nminimizing a regularized weighted binary cross-entropy\nX\u0002\nX\n\u0001\n\u0001\u0003\nLNPLM [fw ] =\nwR (1 − y) log 1 + efw + y log 1 + e−fw + λ\nwi wj ki (xj ) (7)\ni,j\n\n(x,y)\n\nTo ensure robustness, the size of the reference sample |R| is chosen to be substantially larger than the\ndata |D| and is reweighted so that the expected yield under H0 matches the expected experimental\none, which may differ from the observed size |D|. This design choice makes the test sensitive to both\nshape and normalization deviations.1\nOnce the training is complete, the test statistic is estimated from the solution fŵ as\n\n\n\u0010\n\u0011\nX\ntNP (D) = −2 \nwR (1 − y) efŵ (x) − 1 − yfŵ (x)\n\n(8)\n\n(x,y)\n\nTo calibrate the test, we estimate the distribution p(tNP |H0 ) via pseudo-experiments (\"toys\"), generating (i.e. sampling from a larger pool) datasets under the null hypothesis and computing the\ncorresponding test statistics to form an empirical distribution T0 . The p-value is then evaluated\nempirically as:\n1 X\np=\nI[t &gt; t(D)] .\n(9)\n|T0 |\nt∈T0\n\nIt can also be estimated asymptotically from the distribution of T0 , which can be fit to a suitable χ2\ndistribution [4]. The asymptotic estimate is useful in cases where the deviation of D with respect to\nR is large (e.g. Z = 5σ), in which case the number of toys required for the empirical estimate would\nbe prohibitively large.\nThe power of the NPLM test strongly depends on the choice of the kernels’ width, as it determines\nthe scale of distortions the model is sensitive to. To mitigate this feature and make the model more\nrobust, we adopt an extended version of the algorithm introduced in [53], where multiple widths are\nconsidered and combined to obtain a final p-value. The authors of [53] explore several options for\ncombining the tests based on \"local\" p-values, but in this work we choose the average of p-values as\na rule. The average score is typically less powerful than the single \"optimal\" kernel, which can be\nconsidered a kind of \"look-elsewhere\" effect accounting for various kernel hypotheses.\nWe consider six different kernel widths for our experiments, with their precise numerical values\nchosen according to the distribution of pairwise distances between data points in the embedding\nspace. More precisely, the first five values are the 1st, 25th, 50th, 75th, and 99th percentiles of the\nempirical pairwise distance distribution (computed with a subset data points from the training set);\nthe last value is twice the 99th percentile, and it ensures sensitivity to out-of-distribution anomalies.\nThis choice means the numerical kernel widths vary among datasets, so we denote them by their\ncorresponding quantiles: σker ∈ {q1 , q25 , q50 , q75 , q99 , 2q99 }.\nThe NPLM procedure provides a flexible, multivariate, unbinned likelihood-ratio test that is agnostic\nto the source of the anomaly, making it well-suited for unsupervised anomaly detection tasks.\nComparisons with alternative GoF approaches presented in [50] show the impressive sensitivity of\nthe method to subtle distortions of the data density distribution. As for any GoF approach relying on\ndensity estimation from empirical samples, limitations arise when scaling the data dimensionality.\nIn this work, we target the curse of dimensionality by compressing high-dimensional raw data with\ncontrastive embeddings.\n1\n\nThis sensitivity is important in contexts where data collection windows determine |D|, and deviations in\nevent rates may signal anomalies.\n\n5\n\n\f4\n\nDatasets\n\nWe demonstrate AutoSciDACT on a diverse collection of five synthetic, image, and scientific datasets.\nEach dataset contains a large collection of data from \"background\" (i.e. well-understood) classes that\nare used in the contrastive pre-training phase, along with a set of anomalous \"signal\" data. In the\ndiscovery phase we construct datasets D with small signal injections and use NPLM to detect the\nnovel component. We briefly describe each dataset below, with additional details available in App. A.\nDue to space constraints, we defer two further studies to the appendix: a genomics task identifying\nnovel butterfly hybrids from wing images (App. A.6), and searching for four-lepton decays of the\nHiggs boson in real LHC data (App. E).\nSynthetic Data The synthetic dataset is designed to illustrate the core functionality of AutoSciDACT\nindependent of details specific to scientific datasets. It consists of points X ⊂ RD+M with D\nmeaningful dimensions and M noisy dimensions. The noisy dimensions are sampled from U(0, 1),\nand the meaningful dimensions are populated by N Gaussian clusters N (µi , Σi ) (i = 1, . . . , N )\nwith means µi ∼ U(0, 1) and covariances Σi ∼ U(0, 0.5). The pairwise distances of the Gaussian\nclusters are adjusted such that a 1% injection of one cluster on top of 10k samples of another yields a\ndeviation of 3.5 standard deviations. The full D + M -dimensional space is then randomly rotated to\nobscure the discriminating variables. The contrastive embedding is trained on N − 1 clusters with\none held out as a signal, with the backbone architecture fθ being a simple MLP.\nAstronomy For an astronomical baseline we choose gravitational wave data recorded by the\nLaser Interferometer Gravitational-Wave Observatories (LIGO) in Hanford, WA and Livingston,\nLA [54]. Although gravitational waves from compact binary systems have been detected [55], many\nhypothetical sources remain unobserved, making the challenge particularly intriguing for anomaly\ndetection methods. The data consist of 50 ms time-series signals from two channels - one for each\ninterferometer - sampled at 4096 Hz (200 measurements per channel) [56, 57]. The different classes\nof data consist of pure background (∼ gaussian noise), \"glitches\" (periods of short-duration transient\ninstrumental noise), and six observed or hypothetical sources of astrophysical signals. A seventh\nsignal class with \"white noise burst\" (WNB) waveforms is held out from pre-training and is injected as\nan anomaly in the discovery phase. The encoder architecture is a one-dimensional ResNet, following\nthe technical setup explored in [58] for identification of binary black holes.\nParticle Physics Our particle physics baseline is J ET C LASS [59, 60], a large dataset consisting of\nsimulated jets: energetic, collimated streams of O(100) particles that are produced in proton-proton\ncollisions at the Large Hadron Collider (LHC). We use a subset of J ET C LASS consisting of jets from\nquantum chromodynamics (QCD) processes (quark/gluon), top quark decays (t → bqq ′ ), and W/Z\nvector boson decays (V → qq ′ ). We hold out signal jets from boosted Higgs boson decays to bottom\nquarks (H → bb̄), inspired by recent measurements of H → bb̄ in the combined gluon fusion and\nvector boson production modes by the CMS experiment [61]. We use the Particle Transformer (ParT)\narchitecture [60] – a variant of the Transformer architecture [62] adapted for particle physics – as the\ncontrastive encoder.\nHistology As an example from life sciences, we aim to identify abnormal tissue in histopathological\nimages. The abundance of healthy tissue data and the difficulty in collecting samples with various\nabnormalities render histology particularly well-suited to anomaly-detection tasks. We use publicly\navailable optical microscope images from stained tissue samples [63]. Our reference sample contains\nseven classes of tissue from mice (brain, heart, kidney, liver, lung, pancreas, spleen) and one class of\nnormal liver tissue from rats. We aim to detect anomalous mouse liver tissue caused by non-alcoholic\nfatty liver disease (NAFLD). Inputs are 256x256 pixel (0.44µm/pixel) resolution tissue tiles extracted\nfrom the whole slide image with Masson’s trichome staining. As a backbone, we train the best\nperforming architecture from Ref. [25], EfficientNet-B0 [64].\nImages We use the CIFAR-10 dataset [65], arbitrarily holding out class 1 as the anomaly and\npre-training on the other nine classes. In the discovery phase of the pipeline, we use images from\nCIFAR-5m [66] to supplement the CIFAR-10 test set and expand the number of data points available\nfor hypothesis testing.2 We use a ResNet-50 encoder backbone with pre-trained weights [67],\nswapping out only the final fully connected layer with a slightly larger MLP and fine-tuning it on the\nCIFAR contrastive embedding task.\n2\n\nCIFAR-5m was introduced in [66] and consists of images generated by a diffusion model trained on\nCIFAR-10, which were found to be nearly indistinguishable from CIFAR-10 by a pre-trained classifier.\n\n6\n\n\fQCD\nTop\n\nW qq\nZ qq\nH bb\n\nSineGaussian\nKink\nBBH\nKinkKink\nGaussian\nBackground\nCusp\nGlitches\nWhite Bursts\n\nFigure 2: Contrastive embeddings for Particle physics (left) and Astronomy (right) datasets. The\nhigh-dimensional input is projected down to four dimensions (α, β, γ, δ). Background classes are\nshown in hues of blue and green, while the anomaly is overlaid in hot pink.\n\n5\n\nExperiments\n\nEmbedding We train and evaluate the AutoSciDACT pipeline on each dataset in the same manner,\nmaking only small adjustments in pre-training to adapt to the specifics of each dataset (see App. A for\nfull details). We fix the embedding dimension to d = 4 for all encoders to put each on equal footing\nfor NPLM, whose performance varies with input dimensionality. The choice of a low embedding\ndimension is made to ensure that statistical tests remain tractable, and to demonstrate that it is\npossible to obtain strong anomaly detection performance with a very compact representation (see\nApp. B.3 for a study of larger embedding dimensions). In Fig. 2 we visualize the learned contrastive\nembeddings for JetClass and LIGO, with embeddings of the anomalous class - which was not included\nin the training - indicated in pink. The anomalous cluster in JetClass manifests as an extended and\ndistinct cluster, while in LIGO it is an overdensity near a background-populated region. Flagging\nthe latter would be challenging for traditional per-datapoint anomaly detection methods, but we will\ndemonstrate that NPLM detects it as an overdensity.\nAnomaly detection &amp; hypothesis testing We follow a standardized procedure for signal injection,\nanomaly detection, and hypothesis testing for each dataset. As described in Sec. 3.2, we compile a\nreference sample R from the test set composed entirely of the known classes used in training. We then\nconstruct a \"observed data\" set D, also from the known classes and in the same relative proportions\nas R. We mimic the presence of novelty in D by injecting some number NS = fS |D| of anomalous\nsignal datapoints from the held out class, where typically fS ≲ 0.1. For each injection rate fS , we run\n500 NPLM pseudo-experiments to populate a distribution of test statistics t(D; fS ), re-sampling D\nand signal injections each time.3 To calibrate the test, we run 500 additional pseudo-experiments with\nfS = 0 to populate a reference distribution of t(D|fS = 0). The empirical and asymptotic p-value\nand Z-score are computed. For each dataset, we scan fS across a range of injection fractions and\nplot the resulting Z-scores in Fig. 3. The size and composition of R and D are fixed by the practical\nlimitations of each dataset (i.e. the test set size), and fS is varied in a range where NPLM starts to\nbecome sensitive to the injected signal. This information is summarized in Table 1 in App. A. Each\npanel of Fig. 3 also includes results from three baseline statistical tests to compare with NPLM: two\nsupervised tests that incorporate explicit knowledge of the signal, and a test based on the Mahalanobis\ndistance [28].\nSupervised baselines We use two fully-supervised baselines as an estimate of best-case anomaly\ndetection performance. We denote them \"supervised\" and \"ideal supervised\", distinguishing the\nextent to which knowledge of the true signal is utilized. For the \"supervised\" baseline we train an\nMLP to identify the desired signal in the contrastive embedding space, while for \"ideal supervised\"\n3\n\nIn cases where the test datasets are large enough, we re-sample R as well. Full details are in Appendix A.\n\n7\n\n\fSynthetic Dataset\n\nSynthetic Dataset\n\n12\n10\n\nNN Mahalanobis\nRaw Mahalanobis\nSupervised\nIdeal Supervised\n\n4\n3\n\n6\n4\n2\n\n0 0\n\n5\n\n10\n\n15\n\n20\n\nNumber of Additional Dim\n\nAsymptotic NPLM ( ker = 2q99)\nEmpirical NPLM ( ker = 2q99)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\n\n0\n\n10\n\n8\n\n10\n\n8\n\n6\n\n4\n\nMax Zemp with Ntoys = 500\n2\n\n10\n\nZ Score ( )\n\n4\n\n4\n\n6\n\n8\n\nInjected Anomaly Fraction (%)\n\n(d)\n\n0.50\n\n0.75\n\n10\n\n1.00\n\n0\n\n5.0\n\n7.5\n\n10.0\n\n1.50\n\n1.75\n\n2.00\n\nCIFAR, Class 1 anomaly\n\nAsymptotic NPLM ( ker = q99)\nEmpirical NPLM ( ker = q99)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\n\n6\n\n4\n\nMax Zemp with Ntoys = 500\n\n2\n\n2.5\n\n1.25\n\nInjected Anomaly Fraction (%)\n\nMax Zemp with Ntoys = 500\n2\n\n2\n\n0.25\n\n(c)\n\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\n\n8\n\n6\n\n0\n\n6\n\nHistology, Liver disease anomaly\n\n4\n\nInjected Anomaly Fraction (%)\n\n(b)\n\nLIGO, WNB anomaly\n\nZ Score ( )\n\nZ Score ( )\n\n8\n\n4\n\n2\n\n2\n\n(a)\n\n10\n\n6\n\nMax Zemp with Ntoys = 500\n\n0\n\n25\n\nJetClass, H bb anomaly\n\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\n\nMax Zemp with Ntoys = 500\n\n2\n1\n\n8\n\nZ Score ( )\n\n8\n\nZ Score ( )\n\n5\n\nZ Score ( )\n\n6\n\n10\n\nAsymptotic NPLM ( ker = q75)\nEmpirical NPLM ( ker = q75)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\n\n7\n\n12.5\n\n15.0\n\n17.5\n\nInjected Anomaly Fraction (%)\n\n20.0\n\n(e)\n\n0\n\n2\n\n4\n\n6\n\n8\n\nInjected Anomaly Fraction (%)\n\n10\n\n(f)\n\nFigure 3: Statistical significances (Z scores) of NPLM and other baseline methods for detecting\nvarious fractions of anomalous signals injected into background-dominated samples in (a) scanning\nadditional random variables to the same Synthetic toy at a fixed fraction of 0.6% with 10k Background,\nand then for the fraction for (b) Synthetic (2k), (c) particle physics, (d) astronomy, (e) histology, and\n(f) image datasets. In all cases, NPLM is able to discover very small signals with high confidence.\nThe upper limit of the empirical Z scores is indicated by a gray line at roughly 2.88σ and is set by the\nfixed number of pseudo-experiments (500), so empirical numbers are not quoted beyond this point.\nThe Asymptotic NPLM approximates the large pseudo-experiment limit at large Z scores.\n\nbaseline we do the same but first re-train the contrastive embedding with the true signal added to\nthe training set (the encoder has explicit knowledge of the signal). The reference R and observed\nD datasets are constructed the same way as NPLM, but the hypothesis test relies on more typical\nstatistical methodology. We construct one-dimensional distributions of classifier scores s (normalized\nto the range [0,1]), and use the points in R to construct a background-only shape template fR (s) and\nsignal points to construct a signal template fS (s). We then perform a binned maximum likelihood\nfit to the classifier scores in D under the null (H0 : D ∼ a1 pR (s)) and alternative (H1 : D ∼\na1 pR (s) + a2 pS (s)) hypotheses and compute the test-statistic ∆χ2 = χ2H0 − χ2H1 . We compute\nempirical and asymptotic4 p-values and Z-scores over many pseudo-experiments [68].\nMahalanobis baseline As a comparison with analytic anomaly score, we use the Mahalanobis\ndistance metric [28]. For each pseudo-experiment we compute the mean µi and covariance Σi for\nthe embeddings of each background class i in R. The Mahalanobis distance is then\nP dMaha (x, R) =\nmini (x − µi )T Σ−1\ni (x − µi ), and we define the test statistic as tMaha (D) =\nx∈D dMaha (x, D).\nEmpirical p-values and Z-scores are computed as before.\n\n4\n\n∆χ2 is asymptotically χ2 distributed with one degree of freedom.\n\n8\n\n\f6\n\nDiscussion\n\n6.1\n\nResults\n\nThe results in Fig. 3 clearly demonstrate the power of the AutoSciDACT pipeline, with NPLM\nflagging highly statistically significant deviations (Z ≳ 3 or p ≲ 10−3 ) with signal fractions as\nlow as 1%. The two supervised baselines provide a reasonable upper limit on the sensitivity to the\nsignal given full knowledge of its distribution in the embedded space, and in some cases, NPLM\nperforms near this limit. Beyond roughly 5σ, some trends break down, but at this level of significance\n(p ∼ 10−7 ), discovery is extremely clear.\nIn all but the synthetic datasets, NPLM significantly outperforms the Mahalanobis baseline due to\nthe flexible range of distortions and overdensities it is capable of modeling in the input space. The\nMahalanobis test is best suited to cases where each background cluster is roughly normally distributed,\nand by construction is not sensitive to overdensities near the bulk of any given cluster. Since the\nsynthetic dataset is constructed from Gaussian clusters, Mahalanobis is quite effective in this case.\nIn Fig. 3(a), we leverage the computational efficiency of Mahalanobis distance by running over\n100 toy synthetic datasets per point, comparing performance on raw versus embedded inputs. As is\nclear with the raw performance, additional random variables quickly destroy the sensitivity to hidden\nsignals. Sensitivity is preserved across all numbers of random variables using the fixed-dimensional\nembeddings as inputs, as the large number of noisy dimensions has little impact on the quality of the\nembedding.\nFor both the LIGO and JetClass dataset, we approach the supervised limit at a Z-score of 3, which\nrivals or exceeds all anomaly detection algorithms within their respective domains [69–74]. While astronomy and particle physics have long leveraged statistically rigorous anomaly-detection techniques,\ntheir application to histology illustrates a successful transfer of methods across scientific disciplines.\nThe results on the histology datasets align with the findings reported in [25], which demonstrate\nthat embedding spaces constructed with label information outperform those based solely on data\naugmentations. With AutoSciDACT, we introduce a new method capable of detecting localized\nabnormalities that may be present in only a small fraction of tissue, a capability that is essential both\nfor early detection of disease and for guiding pathologists’ judgments on toxic compounds.\n6.2\n\nLimitations\n\nDomain knowledge Since AutoSciDACT relies exclusively on domain knowledge in the label\ninformation, its performance is highly correlated with the label quality. Although labeling is easy\nand accurate in some domains (e.g. simulations, or organ labels for histological patches), labeling\nlarge training subsets can be laborious or impossible. For all baseline results, we also assume\nequal distributions from all background classes in the reference distribution for both pre-training\nand discovery. However, the actual composition of the reference sample during discovery needs to\nresemble the one in the observed data, and may require additional input from domain experts. These\nare problems routinely solved by scientists, so they do not pose a major obstacle to implementing the\npipeline.\nEmbedding dimensionality Embedding into a small space (d = 4) limits expressivity, though the\nfeatures learned in contrastive pre-training will typically be more useful than handpicked variables.\nThis is most evident in the LIGO and CIFAR-10 results in Fig. 3, where the \"ideal supervised\"\nbenchmark falls short of the supervised one when it should in principle do better. This is due to the\ndensity of a large number of classes, which struggle to be perfectly separated in the four-dimensional\nspace. The \"ideal\" scenario, including an additional class in the learned space, exacerbates this\nproblem. The embedding dimension can be reasonably scaled up (see App. B.3), but beyond a certain\npoint (e.g. hundreds or thousands of dimensions) NPLM’s sensitivity will degrade substantially due\nto the sparsity of the data.\nDomain shift and uncertainties In all experiments, we assume that the reference dataset correctly\nresembles the background distribution of the data. While this is an exact assumption in cases where it\nis possible to label subsets of data, the reference sample might contain domain shifts if it is constructed\nfrom data recorded under different conditions or from simulation. The impact of domain shift on\ncontrastive embeddings has been studied in [75], and the inclusion of epistemic uncertainties within\n9\n\n\fboth NPLM and the embeddings is possible [50, 76]. Extensions of AutoSciDACT, including domain\nshifts and estimation of the associated epistemic uncertainties, are left for future work.\n6.3\n\nConclusion &amp; Future Work\n\nIn summary, we have presented what is, to our knowledge, the first end-to-end scientific pipeline\nfor novelty discovery in arbitrary datasets with a rigorous statistical foundation based on hypothesis\ntesting. We show that using AutoSciDACT, we discover anomalous signals with high statistical significance (≥ 3σ) even when the data contains only a percent-level signal fraction and the dimensionality\nof the raw data is large. By applying AutoSciDACT to five different datasets from four different\nscientific domains, we prove the methods’ universality and transferability, enabled by the strict decorrelation of expert knowledge encapsulated in label information from the actual analysis pipeline. For\na comprehensive scientific outcome, incorporating potential domain shifts along with their associated\nuncertainties is essential. We plan to further extend AutoSciDACT through known extensions of our\nmethods. More generally, by abstracting the scientific method, our approach presents a framework\nthat automates scientific discovery, leading to the possibility of rapid, comprehensive, and rigorous\nscientific analysis on all data.\n\n7\n\nAcknowledgments\n\nThis work is supported by the National Science Foundation under Cooperative Agreement\nPHY-2019786 (The NSF AI Institute for Artificial Intelligence and Fundamental Interactions,\nhttp://iaifi.org/). CR acknowledges support under a Postdoc.Mobility fellowship from the Swiss\nNational Science Foundation (SNF) (Grant No. 222340). Computations in this paper were run on the\nFASRC Cannon cluster supported by the FAS Division of Science Research Computing Group at\nHarvard University.\nFollowing the publication in NeurIPS. It was pointed out that reference [12] was linked to an incorrect,\nAI-hallucinated article. We acknowledge this mistake, which resulted from an error in preparing the\nBibTeX citation using LLMs, prompting the LLM to generate the BibTeX citation with the correct\nfirst author and the first word of the title. The updated draft now includes the intended reference.\n\nReferences\n[1] Chris Lu, Cong Lu, Robert Tjarko Lange, Jakob Foerster, Jeff Clune, and David Ha. The\nai scientist: Towards fully automated open-ended scientific discovery. arXiv preprint\narXiv:2408.06292, 2024.\n[2] Yutaro Yamada, Robert Tjarko Lange, Cong Lu, Shengran Hu, Chris Lu, Jakob Foerster, Jeff\nClune, and David Ha. The ai scientist-v2: Workshop-level automated scientific discovery via\nagentic tree search. arXiv preprint arXiv:2504.08066, 2025.\n[3] Juraj Gottweis, Wei-Hung Weng, Alexander Daryin, Tao Tu, Anil Palepu, Petar Sirkovic,\nArtiom Myaskovsky, Felix Weissenberger, Keran Rong, and Ryutaro Tanno. Towards an ai\nco-scientist. arXiv preprint arXiv:2502.18864, 2025.\n[4] Marco Letizia, Gianvito Losapio, Marco Rando, Gaia Grosso, Andrea Wulzer, Maurizio Pierini,\nMarco Zanetti, and Lorenzo Rosasco. Learning new physics efficiently with nonparametric\nmethods. Eur. Phys. J. C, 82(10):879, 2022. doi: 10.1140/epjc/s10052-022-10830-y.\n[5] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework\nfor contrastive learning of visual representations. In International Conference on Machine\nLearning (ICML), pages 1597–1607. PMLR, 2020.\n[6] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for\nunsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on\nComputer Vision and Pattern Recognition (CVPR), pages 9729–9738, 2020.\n[7] Adrien Bardes, Jean Ponce, and Yann LeCun. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906, 2021.\n10\n\n\f[8] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Selfsupervised learning via redundancy reduction. In International conference on machine learning,\npages 12310–12320. PMLR, 2021.\n[9] Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola,\nAaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. Advances in\nneural information processing systems, 33:18661–18673, 2020.\n[10] Beliz Gunel, Cheng Du, Alexis Conneau, and Veselin Stoyanov. Supervised contrastive\nlearning for pre-trained language model fine-tuning. In International Conference on Learning\nRepresentations (ICLR), 2021.\n[11] Alec Radford, Jong Wook Kim, Jack Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal,\nGirish Sastry, Amanda Askell, Pamela Mishkin, Miles Clark, et al. Learning transferable\nvisual models from natural language supervision. In International Conference on Machine\nLearning, pages 8748–8763. PMLR, 2021.\n[12] Mehdi Azabou, Mohammad Gheshlaghi Azar, Ran Liu, Chi-Heng Lin, Erik C Johnson, Kiran\nBhaskaran-Nair, Max Dabagia, Bernardo Avila-Pires, Lindsey Kitchell, Keith B Hengen,\net al. Mine your own view: Self-supervised learning through across-sample prediction. arXiv\npreprint arXiv:2102.10106, 2021.\n[13] Charles Guille-Escuret, Pau Rodriguez, David Vazquez, Ioannis Mitliagkas, and Joao Monteiro.\nCadet: Fully self-supervised out-of-distribution detection with contrastive learning. Advances\nin Neural Information Processing Systems, 36:7361–7376, 2023.\n[14] Puck de Haan and Sindy Löwe. Contrastive predictive coding for anomaly detection. arXiv\npreprint arXiv:2107.07820, 2021.\n[15] Izhak Golan and Ran El-Yaniv. Deep anomaly detection using geometric transformations.\nAdvances in neural information processing systems, 31, 2018.\n[16] Jihoon Tack, Sangwoo Mo, Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via\ncontrastive learning on distributionally shifted instances. Advances in neural information\nprocessing systems, 33:11839–11852, 2020.\n[17] Hao Liu and Pieter Abbeel. Hybrid discriminative-generative training via contrastive learning.\narXiv preprint arXiv:2007.09070, 2020.\n[18] Umar Khalid, Ashkan Esmaeili, Nazmul Karim, and Nazanin Rahnavard. Rodd: A selfsupervised approach for robust out-of-distribution detection. In 2022 IEEE/CVF Conference\non Computer Vision and Pattern Recognition Workshops (CVPRW), pages 163–170. IEEE,\n2022.\n[19] Jim Winkens, Rudy Bunel, Abhijit Guha Roy, Robert Stanforth, Vivek Natarajan, Joseph R Ledsam, Patricia MacWilliams, Pushmeet Kohli, Alan Karthikesalingam, Simon Kohl, et al. Contrastive training for improved out-of-distribution detection. arXiv preprint arXiv:2007.05566,\n2020.\n[20] Sina Mohseni, Mandar Pitale, JBS Yadawa, and Zhangyang Wang. Self-supervised learning\nfor generalizable out-of-distribution detection. Proceedings of the AAAI Conference on\nArtificial Intelligence, 34(04):5216–5223, Apr. 2020. doi: 10.1609/aaai.v34i04.5966. URL\nhttps://ojs.aaai.org/index.php/AAAI/article/view/5966.\n[21] Vikash Sehwag, Mung Chiang, and Prateek Mittal. Ssd: A unified framework for selfsupervised outlier detection. arXiv preprint arXiv:2103.12051, 2021.\n[22] Nicolas Baron Perez, Marcus Brüggen, Gregor Kasieczka, and Luisa Lucie-Smith. Classification of radio sources through self-supervised learning, 2025. URL https://arxiv.org/\nabs/2503.19111.\n11\n\n\f[23] Sara Webb, Michelle Lochner, Daniel Muthukrishna, Jeff Cooke, Chris Flynn, Ashish Mahabal,\nSimon Goode, Igor Andreoni, Tyler Pritchard, and Timothy M C Abbott. Unsupervised\nmachine learning for transient discovery in deeper, wider, faster light curves. Monthly Notices\nof the Royal Astronomical Society, 498(3):3077–3094, 09 2020. ISSN 0035-8711. doi:\n10.1093/mnras/staa2395. URL https://doi.org/10.1093/mnras/staa2395.\n[24] Benjamin Voigt, Oliver Fischer, Bruno Schilling, Christian Krumnow, and Christian Herta.\nInvestigation of semi- and self-supervised learning methods in the histopathological domain.\nJournal of Pathology Informatics, 14:100305, 2023. ISSN 2153-3539. doi: https://doi.org/\n10.1016/j.jpi.2023.100305. URL https://www.sciencedirect.com/science/article/\npii/S2153353923001190.\n[25] Igor Zingman, Birgit Stierstorfer, Charlotte Lempp, and Fabian Heinemann. Learning image\nrepresentations for anomaly detection: Application to discovery of histological alterations\nin drug development. Medical Image Analysis, 92:103067, 2024. ISSN 1361-8415. doi:\nhttps://doi.org/10.1016/j.media.2023.103067. URL https://www.sciencedirect.com/\nscience/article/pii/S1361841523003274.\n[26] Barry M. Dillon, Radha Mastandrea, and Benjamin Nachman. Self-supervised anomaly\ndetection for new physics. Phys. Rev. D, 106:056005, Sep 2022. doi: 10.1103/PhysRevD.106.\n056005. URL https://link.aps.org/doi/10.1103/PhysRevD.106.056005.\n[27] Kyle Metzger, Lana Xu, Mia Sodini, Thea K. Arrestad, Katya Govorkova, Gaia Grosso, and\nPhilip Harris. Anomaly preserving contrastive neural embeddings for end-to-end modelindependent searches at the LHC. 2 2025.\n[28] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for\ndetecting out-of-distribution samples and adversarial attacks. Advances in neural information\nprocessing systems, 31, 2018.\n[29] Arthur Gretton, Karsten M Borgwardt, Malte Rasch, Bernhard Schölkopf, and Alexander\nSmola. A kernel two-sample test. Journal of Machine Learning Research, 13(Mar):723–773,\n2012.\n[30] Felix Biggs, Antonin Schrab, and Arthur Gretton. Mmd-fuse: learning and combining kernels\nfor two-sample testing without data splitting. NIPS ’23, Red Hook, NY, USA, 2023. Curran\nAssociates Inc.\n[31] Antonin Schrab, Ilmun Kim, Mélisande Albert, Béatrice Laurent, Benjamin Guedj, and Arthur\nGretton. Mmd aggregated two-sample test. J. Mach. Learn. Res., 24(1), January 2023. ISSN\n1532-4435.\n[32] David Lopez-Paz and Maxime Oquab. Revisiting classifier two-sample tests. In International\nConference on Learning Representations (ICLR), 2017.\n[33] Masashi Sugiyama, Taiji Suzuki, and Takafumi Kanamori. Density ratio estimation in machine\nlearning. Cambridge University Press, 2012.\n[34] Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan.\nDo deep generative models know what they don’t know? In International Conference on\nLearning Representations (ICLR), 2019.\n[35] Olmo Cerri, Thong Q. Nguyen, Maurizio Pierini, Maria Spiropulu, and Jean-Roch Vlimant.\nVariational Autoencoders for New Physics Mining at the Large Hadron Collider. JHEP, 05:\n036, 2019. doi: 10.1007/JHEP05(2019)036.\n[36] Pratik Jawahar, Thea Aarrestad, Nadezda Chernyavskaya, Maurizio Pierini, Kinga A. Wozniak,\nJennifer Ngadiuba, Javier Duarte, and Steven Tsan. Improving variational autoencoders for\nnew physics detection at the lhc with normalizing flows. Frontiers in Big Data, Volume\n5 - 2022, 2022. ISSN 2624-909X. doi: 10.3389/fdata.2022.803685. URL https://www.\nfrontiersin.org/journals/big-data/articles/10.3389/fdata.2022.803685.\n12\n\n\f[37] Ekaterina Govorkova et al. Autoencoders on field-programmable gate arrays for real-time,\nunsupervised new physics detection at 40 MHz at the Large Hadron Collider. Nature Mach.\nIntell., 4:154–161, 2022. doi: 10.1038/s42256-022-00441-3.\n[38] Thorben Finke, Michael Krämer, Alessandro Morandini, Alexander Mück, and Ivan Oleksiyuk.\nAutoencoders for unsupervised anomaly detection in high energy physics. JHEP, 06:161,\n2021. doi: 10.1007/JHEP06(2021)161.\n[39] Abhijith Gandrakota. Realtime Anomaly Detection at the L1 Trigger of CMS Experiment.\nPoS, ICHEP2024:1025, 2025. doi: 10.22323/1.476.1025.\n[40] Vasilis Belis, Patrick Odagiu, and Thea Klaeboe Aarrestad. Machine learning for anomaly\ndetection in particle physics. Reviews in Physics, 12:100091, 2024. ISSN 2405-4283. doi:\nhttps://doi.org/10.1016/j.revip.2024.100091. URL https://www.sciencedirect.com/\nscience/article/pii/S2405428324000017.\n[41] D. Abadjiev et al. Autoencoder-Based Anomaly Detection System for Online Data Quality\nMonitoring of the CMS Electromagnetic Calorimeter. Comput. Softw. Big Sci., 8(1):11, 2024.\ndoi: 10.1007/s41781-024-00118-z.\n[42] Oliver Knapp, Olmo Cerri, Guenther Dissertori, Thong Q. Nguyen, Maurizio Pierini, and JeanRoch Vlimant. Adversarially Learned Anomaly Detection on CMS Open Data: re-discovering\nthe top quark. Eur. Phys. J. Plus, 136(2):236, 2021. doi: 10.1140/epjp/s13360-021-01109-4.\n[43] Sang Eon Park, Dylan Rankin, Silviu-Marian Udrescu, Mikaeel Yunus, and Philip Harris.\nQuasi Anomalous Knowledge: Searching for new physics with embedded knowledge. JHEP,\n21:030, 2020. doi: 10.1007/JHEP06(2021)030.\n[44] Filip Morawski, Michał Bejger, Elena Cuoco, and Luigia Petre. Anomaly detection in\ngravitational waves data using convolutional autoencoders. Machine Learning: Science\nand Technology, 2(4):045014, jul 2021. doi: 10.1088/2632-2153/abf3d0. URL https:\n//dx.doi.org/10.1088/2632-2153/abf3d0.\n[45] Eric A. Moreno, Bartlomiej Borzyszkowski, Maurizio Pierini, Jean-Roch Vlimant, and Maria\nSpiropulu. Source-agnostic gravitational-wave detection with recurrent autoencoders. Mach.\nLearn. Sci. Tech., 3(2):025001, 2022. doi: 10.1088/2632-2153/ac5435.\n[46] Ryan Raikman et al. GWAK: gravitational-wave anomalous knowledge with recurrent autoencoders. Mach. Learn. Sci. Tech., 5(2):025020, 2024. doi: 10.1088/2632-2153/ad3a31.\n[47] Eric M. Metodiev, Benjamin Nachman, and Jesse Thaler. Classification without labels:\nLearning from mixed samples in high energy physics. JHEP, 10:174, 2017. doi: 10.1007/\nJHEP10(2017)174.\n[48] Raffaele Tito D’Agnolo and Andrea Wulzer. Learning New Physics from a Machine. Phys.\nRev. D, 99(1):015014, 2019. doi: 10.1103/PhysRevD.99.015014.\n[49] Raffaele Tito D’Agnolo, Gaia Grosso, Maurizio Pierini, Andrea Wulzer, and Marco Zanetti.\nLearning multivariate new physics. Eur. Phys. J. C, 81(1):89, 2021. doi: 10.1140/epjc/\ns10052-021-08853-y.\n[50] Gaia Grosso, Marco Letizia, Maurizio Pierini, and Andrea Wulzer. Goodness of fit by NeymanPearson testing. 5 2023.\n[51] Raffaele Tito d’Agnolo, Gaia Grosso, Maurizio Pierini, Andrea Wulzer, and Marco Zanetti.\nLearning new physics from an imperfect machine. Eur. Phys. J. C, 82(3):275, 2022. doi:\n10.1140/epjc/s10052-022-10226-y.\n[52] Jerzy Neyman, Egon Sharpe Pearson, and Karl Pearson. Ix. on the problem of the most\nefficient tests of statistical hypotheses. Philosophical Transactions of the Royal Society of\nLondon. Series A, Containing Papers of a Mathematical or Physical Character, 231(694-706):\n289–337, 1933. doi: 10.1098/rsta.1933.0009. URL https://royalsocietypublishing.\norg/doi/abs/10.1098/rsta.1933.0009.\n13\n\n\f[53] Gaia Grosso and Marco Letizia. Multiple testing for signal-agnostic searches for new physics\nwith machine learning. Eur. Phys. J. C, 85(1):4, 2025. doi: 10.1140/epjc/s10052-024-13722-5.\n[54] J. Aasi et al. Advanced LIGO. Class. Quant. Grav., 32:074001, 2015. doi: 10.1088/0264-9381/\n32/7/074001.\n[55] R. Abbott et al. GWTC-3: Compact Binary Coalescences Observed by LIGO and Virgo\nduring the Second Part of the Third Observing Run. Phys. Rev. X, 13(4):041039, 2023. doi:\n10.1103/PhysRevX.13.041039.\n[56] LIGO Scientific. The O3a Data Release, April 2021. URL https://doi.org/10.7935/\nnfnt-hm34.\n[57] LIGO Scientific. The O3b Data Release, November 2021. URL https://doi.org/10.\n7935/pr1e-j706.\n[58] Ethan Marx et al. Machine-learning pipeline for real-time detection of gravitational waves from\ncompact binary coalescences. Phys. Rev. D, 111(4):042010, 2025. doi: 10.1103/PhysRevD.\n111.042010.\n[59] Huilin Qu, Congqiao Li, and Sitian Qian. Jetclass: A large-scale dataset for deep learning in\njet physics, June 2022. URL https://doi.org/10.5281/zenodo.6619768.\n[60] Huilin Qu, Congqiao Li, and Sitian Qian. Particle Transformer for Jet Tagging. 2 2022.\n[61] Armen Tumasyan et al. A portrait of the Higgs boson by the CMS experiment ten years after\nthe discovery. Nature, 607(7917):60–68, 2022. doi: 10.1038/s41586-022-04892-x. [Erratum:\nNature 623, (2023)].\n[62] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez,\nŁukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information\nprocessing systems, 30, 2017.\n[63] I. Zingman, B. Stierstofer, and F. Heinemann. Nafld pathology and healthy tissue samples,\n2022. URL https://osf.io/gqutd/.\n[64] M. Tan and Q.V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks.\npages 6105–6114. International Conference on Machine Learning, ICML, 2019.\n[65] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report,\n2009.\n[66] Preetum Nakkiran, Behnam Neyshabur, and Hanie Sedghi. The deep bootstrap framework:\nGood online learners are good offline generalizers. arXiv preprint arXiv:2010.08127, 2020.\n[67] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image\nrecognition. In Proceedings of the IEEE conference on computer vision and pattern recognition,\npages 770–778, 2016.\n[68] Herman Chernoff. On the distribution of the likelihood ratio. The Annals of Mathematical\nStatistics, 25(3):573–578, 1954.\n[69] Gregor Kasieczka et al. The LHC Olympics 2020 a community challenge for anomaly detection\nin high energy physics. Rept. Prog. Phys., 84(12):124201, 2021. doi: 10.1088/1361-6633/\nac36b9.\n[70] Ryan Raikman et al. A Neural Network-Based Search for Unmodeled Transients in LIGOVirgo-KAGRA’s Third Observing Run. 12 2024.\n[71] Vasileios Skliris, Michael R. K. Norman, and Patrick J. Sutton. Toward real-time detection of\nunmodeled gravitational wave transients using convolutional neural networks. Phys. Rev. D,\n110(10):104034, 2024. doi: 10.1103/PhysRevD.110.104034.\n[72] Georges Aad et al. Weakly supervised anomaly\n√ detection for resonant new physics in the dijet\nfinal state using proton-proton collisions at s = 13 TeV with the ATLAS detector. 2 2025.\n14\n\n\f√\n[73] Georges Aad et al. Dijet resonance search with weak supervision using s = 13 TeV pp\ncollisions in the ATLAS detector. Phys. Rev. Lett., 125(13):131801, 2020. doi: 10.1103/\nPhysRevLett.125.131801.\n[74] Vladimir Chekhovsky et al. Model-agnostic\n√ search for dijet resonances with anomalous jet\nsubstructure in proton-proton collisions at s = 13 TeV. 12 2024.\n[75] Fan Yang, Kai Wu, Shuyi Zhang, Guannan Jiang, Yong Liu, Feng Zheng, Wei Zhang, Chengjie\nWang, and Long Zeng. Class-aware contrastive semi-supervised learning, 2022. URL https:\n//arxiv.org/abs/2203.02261.\n[76] Philip Harris, Jeffrey Krupa, Michael Kagan, Benedikt Maier, and Nathaniel Woodward.\nResimulation-based self-supervised learning for pretraining physics foundation models. Phys.\nRev. D, 111(3):032010, 2025. doi: 10.1103/PhysRevD.111.032010.\n[77] Giacomo Meanti, Luigi Carratino, Ernesto De Vito, and Lorenzo Rosasco. Efficient hyperparameter tuning for large scale kernel ridge regression. In Proceedings of The 25th International\nConference on Artificial Intelligence and Statistics, 2022.\n[78] Giacomo Meanti, Luigi Carratino, Lorenzo Rosasco, and Alessandro Rudi. Kernel methods\nthrough the roof: handling billions of points efficiently. In Advances in Neural Information\nProcessing Systems 32, 2020.\n[79] Sascha Husa, Sebastian Khan, Mark Hannam, Michael Pürrer, Frank Ohme, Xisco Jiménez\nForteza, and Alejandro Bohé. Frequency-domain gravitational waves from nonprecessing\nblack-hole binaries. i. new numerical waveforms and anatomy of the signal. Phys. Rev. D,\n93:044006, Feb 2016. doi: 10.1103/PhysRevD.93.044006. URL https://link.aps.org/\ndoi/10.1103/PhysRevD.93.044006.\n[80] Sebastian Khan, Sascha Husa, Mark Hannam, Frank Ohme, Michael Pürrer, Xisco Jiménez\nForteza, and Alejandro Bohé. Frequency-domain gravitational waves from nonprecessing\nblack-hole binaries. ii. a phenomenological model for the advanced detector era. Phys. Rev. D,\n93:044007, Feb 2016. doi: 10.1103/PhysRevD.93.044007. URL https://link.aps.org/\ndoi/10.1103/PhysRevD.93.044007.\n[81] LIGO Scientific Collaboration, Virgo Collaboration, and KAGRA Collaboration. LVK Algorithm Library - LALSuite. Free software (GPL), 2018.\n[82] Thibault Damour and Alexander Vilenkin. Gravitational wave bursts from cosmic strings.\nPhys. Rev. Lett., 85:3761–3764, 2000. doi: 10.1103/PhysRevLett.85.3761.\n[83] Thibault Damour and Alexander Vilenkin. Gravitational wave bursts from cusps and kinks on\ncosmic strings. Phys. Rev. D, 64:064008, 2001. doi: 10.1103/PhysRevD.64.064008.\n[84] Yuka Matsui and Sachiko Kuroyanagi. Gravitational wave background from kink-kink collisions on infinite cosmic strings. Phys. Rev. D, 100(12):123515, 2019. doi: 10.1103/PhysRevD.\n100.123515.\n[85] B. Abbott et al. Search for gravitational-wave bursts in LIGO data from the fourth science run.\nClass. Quant. Grav., 24:5343–5370, 2007. doi: 10.1088/0264-9381/25/3/039801. [Erratum:\nClass.Quant.Grav. 25, 039801 (2008)].\n[86] Florent Robinet, Nicolas Arnaud, Nicolas Leroy, Andrew Lundgren, Duncan Macleod, and\nJessica McIver. Omicron: a tool to characterize transient noise in gravitational-wave detectors.\nSoftwareX, 12:100620, 2020. doi: 10.1016/j.softx.2020.100620.\n[87] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International\nConference on Learning Representations, 2019. URL https://openreview.net/forum?\nid=Bkg6RiCqY7.\n[88] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint\narXiv:1711.05101, 2017.\n15\n\n\f[89] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern\nRecognition, pages 248–255, 2009. doi: 10.1109/CVPR.2009.5206848.\n[90] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances\nin neural information processing systems, 33:6840–6851, 2020.\n[91] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain\nGelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In\nComputer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020,\nProceedings, Part V 16, pages 491–507. Springer, 2020.\n[92] Anniina Mattila, Chris Jiggins, and Ian Warren. University of Helsinki butterfly collection Anniina Mattila bred specimens, February 2019. URL https://doi.org/10.5281/zenodo.\n2555086.\n[93] Camilo Salazar, Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, and Imogen Gavins.\nCamilo Salazar and Cambridge butterfly wing collection batch 1, May 2019. URL https:\n//doi.org/10.5281/zenodo.2735056.\n[94] Ian Warren and Chris Jiggins. Miscellaneous Heliconius wing photographs (2001-2019) Part\n2, February 2019. URL https://doi.org/10.5281/zenodo.2553501.\n[95] Gabriela Montejo-Kovacevich, Quentin Paynter, and Amin Ghane. Heliconius erato cyrbia,\nCook Islands (New Zealand) 2016, 2019, 2021, September 2021. URL https://doi.org/\n10.5281/zenodo.5526257.\n[96] Gabriela Montejo-Kovacevich, Eva van der Heijden, and Chris Jiggins. Cambridge butterfly\ncollection - GMK Broods Ikiam 2018, November 2020. URL https://doi.org/10.5281/\nzenodo.4291095.\n[97] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, Eva Wiltshire, and Imogen Gavins.\nCambridge butterfly wing collection batch 9, May 2019. URL https://doi.org/10.5281/\nzenodo.2714333.\n[98] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, and Eva Wiltshire. Cambridge\nbutterfly wing collection batch 8, May 2019. URL https://doi.org/10.5281/zenodo.\n2707828.\n[99] Erika Pinheiro de Castro, Christopher Jiggins, Karina Lucas da Silva-Brand0̆0e3o, Andre\nVictor Lucci Freitas, Marcio Zikan Cardoso, Eva Van Der Heijden, Joana Meier, and Ian\nWarren. Brazilian Butterflies Collected December 2020 to January 2021, February 2022. URL\nhttps://zenodo.org/records/5561246.\n[100] Patricio Salazar, Gabriela Montejo-Kovacevich, Ian Warren, and Chris Jiggins. Cambridge\nbutterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 2, January\n2019. URL https://doi.org/10.5281/zenodo.2548678.\n[101] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, and Eva Wiltshire. Cambridge\nbutterfly wing collection batch 7, May 2019. URL https://doi.org/10.5281/zenodo.\n2702457.\n[102] Patricio Salazar, Gabriela Montejo-Kovacevich, Ian Warren, and Chris Jiggins. Cambridge\nbutterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 1, December\n2018. URL https://doi.org/10.5281/zenodo.1748277.\n[103] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, Camilo Salazar, Marianne Elias,\nImogen Gavins, Eva Wiltshire, Stephen Montgomery, and Owen McMillan. Cambridge and\ncollaborators butterfly wing collection batch 10, May 2019. URL https://doi.org/10.\n5281/zenodo.2813153.\n[104] Gabriela Montejo-Kovacevich, Chris Jiggins, and Ian Warren. Cambridge butterfly wing collection batch 1- version 2, May 2019. URL https://doi.org/10.5281/zenodo.3082688.\n16\n\n\f[105] Joana I. Meier, Patricio Salazar, Gabriela Montejo-Kovacevich, Ian Warren, and Chris Jggins.\nCambridge butterfly wing collection - Patricio Salazar PhD wild specimens batch 3, October\n2020. URL https://doi.org/10.5281/zenodo.4153502.\n[106] Chris Jiggins and Ian Warren. Cambridge butterfly wing collection - Chris Jiggins 2001/2\nbroods batch 2, January 2019. URL https://doi.org/10.5281/zenodo.2550097.\n[107] Chris Jiggins and Ian Warren. Cambridge butterfly wing collection - Chris Jiggins 2001/2\nbroods batch 1, January 2019. URL https://doi.org/10.5281/zenodo.2549524.\n[108] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, and Eva Wiltshire. Cambridge\nbutterfly wing collection batch 6, May 2019. URL https://doi.org/10.5281/zenodo.\n2686762.\n[109] Ian Warren and Chris Jiggins. Miscellaneous Heliconius wing photographs (2001-2019) Part\n3, February 2019. URL https://doi.org/10.5281/zenodo.2553977.\n[110] Ian Warren and Chris Jiggins. Miscellaneous Heliconius wing photographs (2001-2019) Part\n1, February 2019. URL https://doi.org/10.5281/zenodo.2552371.\n[111] Gabriela Montejo-Kovacevich, Chris Jiggins, Ian Warren, and Eva Wiltshire. Cambridge\nbutterfly wing collection batch 5, May 2019. URL https://doi.org/10.5281/zenodo.\n2684906.\n[112] Chris Jiggins, Gabriela Montejo-Kovacevich, Ian Warren, and Eva Wiltshire. Cambridge\nbutterfly wing collection batch 3, May 2019. URL https://doi.org/10.5281/zenodo.\n2682458.\n[113] Gabriela Montejo-Kovacevich, Chris Jiggins, and Ian Warren. Cambridge butterfly wing\ncollection batch 2, May 2019. URL https://doi.org/10.5281/zenodo.2677821.\n[114] Patricio A. Salazar, Nicola Nadeau, Gabriela Montejo-Kovacevich, and Chris Jiggins. Sheffield\nbutterfly wing collection - Patricio Salazar, Nicola Nadeau, Ikiam broods batch 1 and 2,\nNovember 2020. URL https://doi.org/10.5281/zenodo.4288311.\n[115] Gabriela Montejo-Kovacevich, Eva van der Heijden, Nicola Nadeau, and Chris Jiggins. Cambridge butterfly wing collection batch 10, November 2020. URL https://doi.org/10.\n5281/zenodo.4289223.\n[116] Samuel Stevens, Jiaman Wu, Matthew J. Thompson, Elizabeth G.Campolongo, Chan Hee\nSong, David Edward Carlyn, Li Dong, Wasila M. Dahdul, Charles Stewart, Tanya Berger-Wolf,\nWei-Lun Chao, and Yu Su. Bioclip: A vision foundation model for the tree of life. In\nProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition\n(CVPR), page 19412-19424, 2024.\n[117] DC Dowson and BV666017 Landau. The fréchet distance between multivariate normal\ndistributions. Journal of multivariate analysis, 12(3):450–455, 1982.\n[118] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter.\nGans trained by a two time-scale update rule converge to a local nash equilibrium. Advances\nin neural information processing systems, 30, 2017.\n[119] Antoine Chatalic, Marco Letizia, Nicolas Schreuder, and Lorenzo Rosasco. An efficient\npermutation-based kernel two-sample test. arXiv preprint arXiv:2502.13570, 2025.\n[120] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet\nclassifiers generalize to imagenet? In International conference on machine learning, pages\n5389–5400. PMLR, 2019.\n[121] Feng Liu, Wenkai Xu, Jie Lu, Guangquan Zhang, Arthur Gretton, and Danica J Sutherland.\nLearning deep kernels for non-parametric two-sample tests. In International conference on\nmachine learning, pages 6316–6326. PMLR, 2020.\n[122] Serguei Chatrchyan et al. Observation of a New Boson at a Mass of 125 GeV with the CMS\nExperiment at the LHC. Phys. Lett. B, 716:30–61, 2012. doi: 10.1016/j.physletb.2012.08.021.\n17\n\n\f[123] Georges Aad et al. Observation of a new particle in the search for the Standard Model\nHiggs boson with the ATLAS detector at the LHC. Phys. Lett. B, 716:1–29, 2012. doi:\n10.1016/j.physletb.2012.08.020.\n[124] Cms open data. URL https://opendata.cern.ch/.\n\n18\n\n\fDataset\n\n|R|\n\n|D|\n\nfS range (%)\n\nSynthetic\n10,000 2,000\n0.5 - 10\nAstronomy\n20,000 4,000\n0.5 - 10\nParticle Physics\n50,000 10,000 0.1 - 2\nHistology\n6,296\n500\n2.5 - 20\nImages (CIFAR-10) 9,000\n1,800\n1 - 10\nGenomics\n1,764\n100\n5 - 20\nTable 1: The reference dataset size, observed dataset size, and range of injected anomaly fractions\n(relative to the background component in D) for each dataset considered in our study. These\nparameters are used when running NPLM pseudo-experiments across a range of signal fractions to\nproduce the results shown in Fig. 3.\n\nA\n\nDataset, Training, and Evaluation Details\n\nAll of the experiments presented in this paper were run on an academic computing cluster. The\ncontrastive trainings were run on a single NVIDIA A100 GPU in all cases, and none took more\nthan a few hours to compute. The kernel-based NPLM tests used the GPU-accelerated Falkon\npackage [77, 78] and also ran on a single GPU, with a typical set of 100 toys with |R| = 10, 000 and\n|D| = 2, 000 taking 10-20 minutes. All other metrics such as the Mahalanobis test were computed\non CPU nodes and were not a significant computational bottleneck.\nTable 1 summarizes the reference dataset sizes |R|, observed dataset sizes |D| and signal fractions\nfS used in the experiments presented in Sec. 5. These numbers are typically limited by the test set\nsizes for each dataset, and by requirement that |R| be significantly larger than |D| for NPLM. We fix\nthe ratio at |R| = 5|D|, except for histology and genomics where the datasets are very small.\nAs mentioned in Sec. 3.2, the kernel size σ is a configurable hyper-parameter of NPLM, and the\nperformance varies somewhat as the kernel width changes. In practice, all NPLM pseudo-experiments\nare run with six different variations of the kernel width σ = [0.1, 1.5, 2.6, 3.6, 4.9, 9.8]. The four\ndimensional input data are standardized according to the mean and standard deviation of the reference\nsample R, so these widths refer to a common scale. The smallest-width kernels are best at adapting\nto small, local features and distortions in the data, while the widest ones can capture excesses or\noutlier far in the tails away from the bulk background distribution. In Fig. 3 of the main text we\npresent the asymptotic and empirical NPLM Z scores corresponding to the best-performing kernel\nwidth, but we also show average empirical Z of all six kernels in black. We plot full results for all\nkernel widths, both asymptotic and empirical Z scores, in App. B.\nA.1\n\nSynthetic Data\n\nThe synthetic dataset aims to broadly look at challenging datasets that are largely overlapping and\nhigh-dimensional. As part of that, we insisted on a series of core elements to ensure a robust\nconstruction. Namely, the chosen mixture of Gaussians\n• signals are fully reproducible,\n• the minimum pairwise optimized significance between clusters was 3.5 standard deviations;\nthis was computed through the computation of a cumulative distribution about the mean\nof the Gaussian, assuming a scenario of 1 percent background in a sample size of 10000\nevents.\n• All discriminating variables were randomly mixed among non-discriminating variables\n• Gaussian means and sigmas are bounded in ranges of [0, 1] and [0.02, 0.5], respectively.\nFor each dataset, we generated 10k events in each of the data classes. Datasets ranging from 3\nseparate classes to 20 were generated, along with additional random variables ranging from 0 to\n30 variables. Additionally, to address the variation of models, we generated roughly 100 separate\nrandom models for each point. The total number of models utilized is 3870.\nWith each model, two trainings are performed, using a simple 4-layer MLP with a separate MLP\nclassifier with no output activation and a projector to compute the contrastive loss; there are a total\n19\n\n\fSynthetic Dataset\n\nSynthetic Dataset\n\n7\n\n7\n\n6\n\nNN Mahalanobis\nRaw Mahalanobis\nRaw Supervised\nSupervised\nIdeal Supervised\n\n5\n\n3\n\nZ Score ( )\n\nZ Score ( )\n\n5\n\n6\n\n2\n\n2\n\n1\n\n1\n\n4\n\n0\n\n4\n\nNN Mahalanobis\nRaw Mahalanobis\nRaw Supervised\nSupervised\nIdeal Supervised\n\n3\n\n4\n\n6\n\n8\n\n10\n\n12\n\n14\n\nNumber of Signals\n\n16\n\n0 0\n\n18\n\n5\n\n10\n\n15\n\n20\n\nNumber of Additional Dim\n\n25\n\nFigure 4: Z-score detection statistic for an anomaly using Mahalanobis distance, and supervised\nlearning on the raw and learned embedded space. (a) We observe the impact of additional signals on\nsensitivity to find an anomaly. (b) We observe the change in sensitivity vs the number of additional\nrandom variables obtained from the average of 100 toys, adding an additional signal model and\ndiscriminating variables with each increment on the x-axis. The green corresponds to the Mahalanobis\ndistance on raw inputs, the orange corresponds to a fully supervised algorithm on raw inputs, and the\nred corresponds to a supervised algorithm trained on the ideal contrastive space, where the signal is\nknown. The blue shows the result of a supervised training (knowing signal) on a contrastive space\nwhere the signal is unknown; the brown shows the result of the Mahalanobis distance on the same\nspace.\nof 12k trainable parameters. The loss function used was SimCLR with τ = 0.01 and λCE = 0.5, a\nlearning rate of 0.001 with a batch size of 1000 is used along with a cosine annealing. Trainings\nare performed over 50 epochs and take roughly 5 minutes on a CPU. Similarly, for the supervised\nalgorithms, a 4-layer MLP of roughly the same size was utilized.\nFigure 4(a) presents the result of scanning over the toy models, computing the asymptotic Mahalanobis\ndistance for the embedded space, the raw space, and applying a supervised algorithm on both, and\nwith an additional supervised algorithm on the embedded space trained with the hidden signal. The\nleft plot adds an additional signal and an additional discriminating dimension with each variable.\nHere, we observe that at least four signals are needed to span the space, and high sensitivity is\nobserved, which gradually goes down as the confusion and density from so many signals make it\nhard for a specific point to separate itself. The right plot shows the impact of additional random\ndimensions on the data. We observed that either embedding or a supervised algorithm is sufficient to\novercome a loss of sensitivity present from just adding random, fluctuating dimensions.\nA.2\n\nAstronomy\n\nWe utilize the AutoSciDACT pipeline to identify anomalous gravitational-wave sources. Our dataset\ncomprises time-series recorded by the two advanced LIGO detectors [54] - Hanford, Washington,\nand Livingston, Louisiana - spanning the third observing run (O3) from April 2019 to March 2020;\nthis data is publicly available [56, 57]. Our data preparation and labeling process closely follows\nthe setup described in [46, 70]. Class-balanced reference sets are constructed by injecting simulated\nsignals into real background; the background class is simply segments with no injections. We\ninject compact-binary coalescences including binary black hole mergers from phenomenological\nmodel IMRPhenomPv2 [79, 80] , (sine-) Gaussian signals [81], signals from cusps [82], kinks [83],\ndouble kink events [84], and signals from band-limited white noise bursts (WNBs) [85]. Moreover, a\ndedicated “glitch” class is obtained using Omicron’s veto criteria [86].\nEach input consists of two sequences, one for each detector, with each sequence containing 200\npoints, corresponding to a 50 ms long time series sampled at 4096 Hz. Exemplary time-series can be\n20\n\n\fWhiteNoiseBurst\n\nLivingston\nHanford\n\n2\n1\n0\n1\n2\n0\n\n10\n\n20\n30\ntime [ms]\n\nnormalized elongation\n\nnormalized elongation\n\nBBH\n\n40\n\n50\n\n2\n0\n2\n0\n\n10\n\nLivingston\nHanford\n20\n30\n40\n50\ntime [ms]\n\nFigure 5: Example LIGO signal waveforms: Signals from binary black holes (left) and white noise\nburst (right).\n\nfound in Fig. 5. The dataset comprises a total of about 530,000 samples, with an near-uniform class\nbalance in the pre-training. To enhance data processing and support network training, the data are\nnormalized to have a unit standard deviation on a per-sample basis. Of the nine total classes, the WNB\nclass is withheld from pre-training and treated as the held-out anomaly for discovery. White-noise\nbursts are deliberately model-agnostic: they represent correlated, band-limited stochastic fluctuations\nwhose spectra are flat over the analysis band. As such they emulate the “worst-case” burst—lacking\ndistinctive phase evolution or chirp structure, providing a stringent test of the pipeline’s capacity to\ndisentangle subtle, structure-poor signals from detector noise.\nThe available data is split into a training, validation and test dataset with the test dataset not only\nutilized for testing the pre-training performance, but also for constructing the reference R and data\ndistribution D for the hypothesis test.\nThe optimization of the backbone encoder fθ - a one-dimensional ResNet with about 7.2M trainable\nweights - uses the combined loss objective (SimCLR temperature τ = 0.5, λCE = 0.5) and the\nAdamW optimizer [87] with an initial learning rate of 0.001 and 350 batch size. To facilitate improved\nconvergence and generalization, a cosine annealing learning rate schedule is employed. The training\nis set up for a maximum of 25 epochs, with early stopping in case the validation loss does not decrease\nfor more than five epochs.\n\nA.3\n\nParticle Physics\n\nJetClass5 is an open-source particle physics dataset introduced in [60]. The training set consists of\n100M jets from 10 classes (10M per class), of which we use five for a total of 50M training samples:\nQCD (quark/gluon), top quark (t → bqq ′ ), W boson (W → qq ′ ), Z boson (Z → q q̄) and Higgs\n(H → bb̄). The validation set consists of 500,000 jets per class and is used during training to monitor\nperformance. The test set consists of 2M jets per class and is used to construct reference and data\nsamples for all NPLM hypothesis tests presented in the main text.\nFor the encoder, we use the particle transformer architecture nearly exactly as described in [60],\nusing a particle embedding of dimension 128, eight self-attention layers with eight heads, and two\nclass-attention layers with the final 4-dimensional embedding derived from the final class token plus\na fully connected layer. We use the same 17 per-particle input features described in [60], including\ninformation on the particle’s energy/momentum, trajectory, and particle type. We cap the input size\nat 64 particles per jet. We train the encoder with a SimCLR temperature τ = 0.1 and a classifier\nstrength of λCE = 0.1, running for 100 epochs with an initial learning rate of 5 × 10−4 annealed to\n10−5 on a cosine schedule and using the AdamW optimizer [88]. We use a batch size of 512.\n21\n\n\fFigure 6: From left to right: exemplary image patches of heart tissue, liver tissue and liver tissue with\na non-alcoholic fat Non-Alcoholic Fatty Liver Disease (NAFLD) [63].\n\nA.4\n\nHistology\n\nExemplary image patches from the publicly available histological dataset [63] are shown in Fig. 6.\nThe training dataset is balanced and includes samples from mouse tissues of the brain, heart, kidney,\nliver, lung, pancreas, and spleen and a separate class containing normal liver tissue samples from\nrats. Each class comprises approximately 6,300 samples. The dataset is split into training, validation,\nand testing sets with a ratio of 70%/20%/10%. In addition, an independent test set consists of\napproximately 2,300 samples of normal mouse liver tissue and an equal number of samples with\nnon-alcoholic fatty liver disease (NAFLD).\nDue to statistical constraints, the reference distribution R is constructed from the training data, with\nprior validation to ensure the absence of overfitting. The data distribution D for normal tissue is\nderived from both the training set and the independent dataset containing only healthy mouse liver\nsamples.\nThe backbone encoder fθ , EfficientNet-B0 [64] with approximately 4.8M trainable parameters, is\noptimized using a combined loss objective, incorporating SimCLR contrastive loss (temperature\nτ = 0.5) and cross-entropy loss with weighting λCE = 0.5. Optimization is performed with the\nAdamW optimizer, using an initial learning rate of 0.001 and a batch size of 32. To promote stable\nconvergence and improved generalization, a cosine annealing learning rate schedule is employed.\nTraining is conducted for a maximum of 25 epochs, with early stopping triggered if the validation\nloss fails to improve for more than five consecutive epochs. Each training run takes between one and\ntwo hours on a single NVIDIA A100 GPU.\nA.5\n\nImages\n\nWe use the CIFAR-10 [65] dataset, applying the standard resize to 232 × 232 with interpolation,\ncrop to 224 × 224, and standardizing using the ImageNet [89] mean and standard deviation. For the\nencoder, we use the Pytorch-provided pre-trained ResNet-50 [67] weights and replace the final fully\nconnected layer with an MLP of hidden dimensions [512, 256, 128] and an output dimension of 4.\nOnly these final MLP weights are floated during training.\nWe use the 50,000 CIFAR-10 training images to pre-train the encoder, using only 45,000 in practice\nbecause class 1 is held out as the anomaly. When evaluating with NPLM we introduce 100,000\nimages from CIFAR-5m [66] in order to boost the number of points available for demonstrating our\nmethod. The approximately 5 million images in CIFAR-5m were generated by an unconditional\ndenoising diffusion probabilistic model (DDPM) [90] trained on CIFAR-10, then labeled by the\n98.5% accurate Big-Transfer model [91]. Trainings took about 1 hour on a single A100 GPU, and\nran for 50 epochs with a learning rate of 10−3 annealed to 10−5 on a cosine schedule and with a batch\nsize of 512. The SimCLR temperature is set to τ = 0.1 and the cross-entropy strength to λCE = 0.5.\n5\n\nhttps://zenodo.org/records/6619768\n\n22\n\n\fFigure 7: From left to right: Exemplary images of two different butterfly subspecies (left, center) and\na hybrid offspring of those species (right).\n\nA.6\n\nGenomics\n\nAs an example from genomics, we evaluate our approach on the dataset provided in the “Butterfly\nHybrid Detection” challenge6 . Butterflies come in different subspecies characterized by visual\ndifferences in color and pattern on the wings and can sometimes mix and produce offspring. We aim\nto detect these anomalies, so called hybrids, with AutoSciDACT.\nThe dataset consists of 1991 colour images of size 224 × 224 pixels, annotated to belong to one of 14\nclasses, with a highly imbalanced class distribution (some classes contain almost 100 times more\ninstances than others) [92–115]. Example images of two different species and a hyrbid are shown in\nFig.7. We adopt a fixed split of 80% training, 10% validation and 10% test sets. Our model uses a\nbackbone encoder based on the BioClip architecture [116], with approximately 430k trainable weights.\nTraining employs the AutoSciDACT combined loss: a contrastive self-supervised term following\nthe SimCLR formulation with temperature parameter τ = 0.5, and a supervised cross-entropy term,\nweighted with λCE = 0.5. Optimization is performed using the AdamW optimizer at a learning\nrate of 0.001 and batch size of 32. We apply cosine annealing learning-rate scheduling over 100\nepochs and minimal value 0.0001. Training is terminated by early stopping when no improvement is\nobserved for five consecutive epochs; in our experiments this is the case after 43 epochs.\nThe contrastive embedding resulting from the projection of image data into a four-dimensional latent\nspace is shown in Fig. 8 (left). Among all experiments, the anomaly in the genomics case shows\nthe clearest separation from the background classes. The performance of AutoSciDACT in this\nsetting is presented in Fig. 8 (right), which displays the statistical significance (Z-scores) obtained by\nNPLM and various baseline methods for detecting varying proportions of hybrid butterfly species\nimages injected in background-dominated samples. We omit asymptotic results, since the underlying\nassumption that the test statistic is χ2 -distributed, is invalid in light of the limited statistics of the\ndataset. The limited statistics of this dataset is also the reason why it is not included in the main\nresults. Notably, the empirical Mahalanobis distance baseline achieves the strongest performance due\nto the excellent separation of the anomalous class in the contrastive embedding space. Conversely,\nthe Maximum Mean Discrepancy (MMD) test yields the weakest performance, potentially due to\nsuboptimal kernel width choice (see Appendix B.2 for further discussion).\n\nB\n\nAdditional Experiments\n\nB.1\n\nImpact of NPLM kernel width\n\nThe choice of NPLM kernel width has a significant impact on the sensitivity of the test, and there is\nno a priori choice that can optimize sensitivity to potentially anomalous features. The results in Fig. 3\nincluded Z-scores from the best-performing kernel and the average over all kernel widths considered.\nFor completeness, we plot Z-scores from all kernel width settings in Figures 9 (asymptotic) and 10\n(empirical). These figures exactly mirror Fig. 3, displaying results for each of the five datasets in\nthe five panels (a)-(e). In Fig. 10 we also show the kernel-averaged Z-score in black. In general,\nintermediate to larger kernels do the best, with only fairly small variations among the top performers.\nThe empirical Z-scores cannot exceed roughly 2.88σ due to the number of pseudo-experiments (500).\n6\n\nhttps://www.codabench.org/competitions/3764/\n\n23\n\n\fSubspecies 0\nSubspecies I\nSubspecies II\nSubspecies III\nSubspecies IV\n\nClasses\n\nSubspecies V\nSubspecies VI\nSubspecies VII\nSubspecies VIII\nSubspecies IX\n\n4.0\nSubspecies X\nSubspecies XI\nSubspecies XII\nSubspecies XIII\nHybrid\n\nGenomics, Hybrid butterflies anomaly\nEmpirical NPLM\nMahalanobis (Empirical)\nMMD (Empirical)\n\n3.5\n\nZ Score (σ)\n\n3.0\n2.5\n\nMax Zemp with Ntoys = 99\n\n2.0\n1.5\n1.0\n0.5\n0.04\n\n6\n\n8\n\n10\n\n12\n\n14\n\n16\n\n18\n\nInjected Anomaly Fraction (%)\n\n20\n\n22\n\nFigure 8: Results for the genomics experiment: Contrastive embeddings in four dimensions (left).\nBackground classes are shown in hues of blue and green, while the anomaly is overlaid in hot pink.\nResults of the statistical tests (right).\n\nB.2\n\nComparisons with additional baselines\n\nWe further contextualize AutoSciDACT’s performance by comparing with two additional anomaly\ndetection baselines: Maximum Mean Discrepancy (MMD) [29] and Fréchet Inception Distance\n(FID) [117, 118].\nNyström approximated Maximum Mean Discrepancy (N-MMD). The Maximum Mean Discrepancy (MMD) is a kernel-based statistical test used to determine whether two datasets come from the\nsame distribution [29]. It works by mapping the data into a high-dimensional reproducing kernel\nHilbert space (RKHS) via a chosen kernel (e.g. Gaussian) and computing the distance between the\nmean embeddings of the two distributions in that space. MMD has been shown to be sensitive to\nsubtle differences between distributions, making it particularly effective in high-dimensional settings.\nHowever, its computational cost, quadratic in the number of examples, limits its applicability to small\nsample sizes or low-dimensional problems. To address this, [119] introduced a scalable variant of the\nMMD test based on a Nyström approximation of the kernel matrix, enabling its use on larger datasets\nwhile maintaining statistical power. Since the NPLM test employed in this work is also built upon the\nNyström approximation, we perform a direct comparison between Nyström-MMD and NPLM under\nmatched settings, using the same number of centroids and same kernel bandwidth.\nFréchet distance (FD). The Fréchet distance has emerged as a popular metric for comparing\nprobability distributions, particularly in the context of generative modeling [117, 118]. Under the\nassumption that both distributions are Gaussian, it admits a closed-form expression involving only\ntheir means and covariances, making it computationally efficient and interpretable. However, this\nassumption can limit its effectiveness when the underlying distributions exhibit significant nonGaussian behavior, such as heavy tails or multimodality. Despite this, the Fréchet distance remains\nwidely used due to its robustness in high-dimensional settings and its ability to capture both mean\nand covariance differences.\nIn Fig 11 we reproduce Fig. 3 with empirical MMD and FID Z-scores included for the particle physics,\nastronomy, histology, and image datasets. NPLM outperforms FID/MMD for the particle physics\nand image datasets, approximately matches them for astronomy, and, surprisingly, underperforms\nin histology. This wide range of outcomes makes it difficult to draw unambiguous conclusions, but\nbroadly suggests that the \"best\" anomaly detection method depends strongly on the structure of the\nembedding space and the size of the dataset at hand. NPLM’s sensitivity scales with available sample\nsize, and the histology dataset has by far the smallest available test datasets among all experiments in\nthe main body of the paper (see Table 1). In such data-constrained cases, other methods may perform\nbetter as they do not require likelihood ratio estimation. In other cases, the structure of the data\nembeddings may also confer an advantage (e.g. if clusters are approximately Gaussian). However,\n24\n\n\fker = q1\nker = q25\nker = q50\n\nker = q1\nker = q25\nker = q50\n\n7\n\n5\n\nAsymptotic Z Score ( )\n\nAsymptotic Z Score ( )\n\n6\n\n4\n3\n2\n1\n\nker = q75\nker = q99\nker = 2q99\n\n6\n5\n4\n3\n2\n\n4\n\n6\n\n8\n\n10\n\n10\n\nHistology, Liver disease anomaly\n\nInjected Anomaly Fraction (%)\n\n(a)\n\nAsymptotic Z Score ( )\n\n8\n\nker = q1\nker = q25\nker = q50\n\n0.2\n\n0.4\n\n0.6\n\n0.8\n\n1.0\n\n1.2\n\n6\n5\n4\n3\n2\n\n(b)\n\nker = q1\nker = q25\nker = q50\n\n14\n\n4\n\n2\n\n2\n\n4\n\n6\n\n8\n\nInjected Anomaly Fraction (%)\n\nCIFAR, Class 1 anomaly\n\n16\n\nker = q75\nker = q99\nker = 2q99\n\n0\n\n1.4\n\nInjected Anomaly Fraction (%)\n\n6\n\n0 2.5\n\n7\n\n1\n\nAsymptotic Z Score ( )\n\n2\n\n0\n\nker = q1\nker = q25\nker = q50\n\n8\n\n1\n0\n\nLIGO, WNB Anomaly\nker = q75\nker = q99\nker = 2q99\n\n9\n\nJetClass, H bb anomaly\n\n8\n\nker = q75\nker = q99\nker = 2q99\n\nAsymptotic Z Score ( )\n\nSynthetic Dataset\n\n7\n\n10\n\n(c)\n\nker = q75\nker = q99\nker = 2q99\n\n12\n10\n8\n6\n4\n2\n0\n\n5.0\n\n7.5\n\n10.0\n\n12.5\n\n15.0\n\n17.5\n\nInjected Anomaly Fraction (%)\n\n20.0\n\n(d)\n\n2.5\n\n5.0\n\n7.5\n\n10.0 12.5 15.0 17.5 20.0\n\nInjected Anomaly Fraction (%)\n\n(e)\n\nFigure 9: Asymptotic NPLM Z scores as a function of injected signal yield for all six kernel choices\nσ = [0.1, 1.5, 2.6, 3.6, 4.9, 9.8] used in pseudo experiments. We show results for our five benchmark\ndatasets: Synthetic (a), JetClass (b), LIGO (c), Histology (d), and CIFAR-10 (e).\nNPLM’s strong performance in all but the most data-constrained cases positions it as a reliable and\ncompetitive choice.\nB.3\n\nVarying embedding dimension\n\nWe use a very low contrastive embedding dimension (d = 4) for the main results of this paper. This\nchoice was made to ensure the tractability of our statistical anomaly detection technique (NPLM),\nwhich relies on statistical hypothesis testing that can quickly lose sensitivity in high dimensions. In\nthis section we explore the impact of increasing the embedding dimension, extending our experiments\nup to d = 327 . Figure 12 shows the Z-score as a function of d for the CIFAR, JetClass, and LIGO\ndatasets, where the best-performing kernel widths are used and the signal injection fractions are set\nsuch that NPLM has good but not fully-saturated sensitivity at the default setting d = 4.\nThere are no unambiguous trends for any of the anomaly detection methods, with all methods\nperforming relatively stably up to d = 32. NPLM’s sensitivity declines very modestly in the CIFAR\nand JetClass examples, but slightly improves in the LIGO example. The MMD and Fréchet metrics\nare similarly stable. Interestingly, the Mahalanobis distance appears to almost always benefit from a\nlarger dimensionality. This could be explained by class-specific clusters having more \"room\" to spread\nout and condense under the contrastive objective in a higher-dimensional space. As Mahalanobis\ndistance is sensitive to the distribution of these clusters, this would likely improve performance\n(assuming that the anomalous cluster is separated from the rest, i.e. not an overdensity in an existing\ncluster). The absence of clear trends for NPLM is encouraging, suggesting AutoSciDACT could\nbe applied to problems requiring higher-dimensional latent spaces. Where possible, however, we\nvouch for keeping the dimensionality low as this is beneficial for classical statistical analysis and\nuncertainty quantification.\n7\n\nThis is still modest relative to standard embedding sizes in e.g. computer vision or natural language, but a\nreasonable choice for many scientific applications.\n\n25\n\n\fker = q1\nker = q25\nker = q50\nker = q75\n\n3.0\n\nAverage\n\nker = q1\nker = q25\nker = q50\nker = q75\n\n4\n\nEmpirical Z Score ( )\n\nEmpirical Z Score ( )\n\n3.5\n\nJetClass H bb anomaly\n\n5\n\nker = q99\nker = 2q99\n\n2.5\n2.0\n1.5\n1.0\n\nker = q1\nker = q25\nker = q50\nker = q75\n\n3.5\n\nAverage\n\n3\n\n2\n\n1\n\n0.5\n\n3.0\n\nker = q99\nker = 2q99\nAverage\n\n2.5\n2.0\n1.5\n1.0\n0.5\n\n2\n\n4\n\n10\n\n5\n\nHistology, Liver disease anomaly\n\n4\n\nker = q1\nker = q25\nker = q50\nker = q75\n\n0.0\n\n100\n\n8\n\n(a)\n\nEmpirical Z Score ( )\n\n0 10 1\n\n6\n\nInjected Anomaly Fraction (%)\n\nInjected Anomaly Fraction (%)\n\n2\n\n3.5\n\n3\n\n2\n\n1\n\n6\n\n8\n\n10\n\n(c)\n4.0\n\nker = q99\nker = 2q99\nAverage\n\n4\n\nInjected Anomaly Fraction (%)\n\n(b)\n\nEmpirical Z Score ( )\n\n0.0\n\nLIGO, WNB anomaly\n\n4.0\n\nker = q99\nker = 2q99\n\nEmpirical Z Score ( )\n\nSynthetic Dataset\n\n4.0\n\n3.0\n\nCIFAR, Class 1 anomaly\n\nker = q1\nker = q25\nker = q50\nker = q75\n\nker = q99\nker = 2q99\nAverage\n\n2.5\n2.0\n1.5\n1.0\n0.5\n\n0 2.5\n\n5.0\n\n7.5\n\n10.0\n\n12.5\n\n15.0\n\n17.5\n\nInjected Anomaly Fraction (%)\n\n20.0\n\n0.0 100\n\n101\n\nInjected Anomaly Fraction (%)\n\n(d)\n\n(e)\n\nFigure 10: Empirical NPLM Z scores as a function of injected signal yield for all six kernel choices\nσ = [0.1, 1.5, 2.6, 3.6, 4.9, 9.8] used in pseudo experiments. We show results for our five benchmark\ndatasets: Synthetic (a), JetClass (b), LIGO (c), Histology (d), and CIFAR-10 (e). We also show the\naverage empirical Z score from all six kernels in black.\n\nB.4\n\nNoisy labels\n\nMany real-world scientific datasets are labeled by hand or by algorithms with known error rates, both\nof which result in some fraction of mislabeled training data. To assess our sensitivity to such cases,\nwe train variants of our JetClass contrastive embedding model with 1, 2, 5, and 10% label noise,\nmeaning x% of samples the training datasets are randomly mislabeled. The results are shown in\nFig. 13, where again the best-performing kernel width is chosen and the injected signal fraction is set\nsuch that NPLM has good performance at zero noise. As expected, sensitivity drops as label noise is\nincreased, falling from 4σ to about 2σ at 10% noise.\n\nC\n\nComparison to previous results from histology\n\nOur setup for the histology study makes use of the same dataset as in [25]. In [25], the authors\nproposed a contrastive learning method for anomaly detection. The learned embedding returns a\n320-dimensional representation, and a standard one-class SVM with the Radial Basis Function (RBF)\nkernel and margin error ν = 0.1 is then trained on anomaly-free data to construct an anomaly score.\nApplying a threshold that ensures zero false positives on the training set, the tiles constituting a data\nsample are tagged as either standard or anomalous. The final anomaly metric used for comparisons\nis an average across the tags of all tiles in the sample. This statistical test assumes the anomaly is\nout-of-distribution and the distribution of the background class in the chosen representation is well\nclustered. While these assumptions are met in [25], out-of-distribution is not ensured for an arbitrary\nrepresentation space agnostic to the anomaly source, which motivates our choice for using NPLM as\na universal statistical test.\nSince [25] does not present results in terms of p-value, we implement the one-class SVM trained\non our four-dimensional embedding space for comparison purposes. We find that the performance\n26\n\n\fJetClass, H bb anomaly\n\n10\n\n6\n\n8\n\n6\n\nZ Score ( )\n\n8\n\nZ Score ( )\n\n10\n\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n4\n\nLIGO, WNB anomaly\n\nAsymptotic NPLM ( ker = 2q99)\nEmpirical NPLM ( ker = 2q99)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nMMD (Empirical)\nFrechet (Empirical)\nSupervised\nIdeal Supervised\n\n4\n\nMax Zemp with Ntoys = 500\n\nMax Zemp with Ntoys = 500\n2\n\n2\n\n0\n\n0.25\n\n0.50\n\n0.75\n\n1.00\n\n1.25\n\n1.50\n\n1.75\n\nInjected Anomaly Fraction (%)\n\n0\n\n2.00\n\n2\n\n(a)\n\n6\n\n8\n\nZ Score ( )\n\nZ Score ( )\n\n10\n\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n8\n\n6\n\n4\n\n6\n\nAsymptotic NPLM ( ker = q99)\nEmpirical NPLM ( ker = q99)\nEmpirical NPLM (Avg kernels)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n4\n\nMax Zemp with Ntoys = 500\n\n2\n\n2\n\n2.5\n\n5.0\n\n7.5\n\n10.0\n\n12.5\n\n15.0\n\n17.5\n\nInjected Anomaly Fraction (%)\n\n10\n\nCIFAR, Class 1 anomaly\n\nMax Zemp with Ntoys = 500\n\n0\n\n8\n\n(b)\n\nHistology, Liver disease anomaly\n\n10\n\n4\n\nInjected Anomaly Fraction (%)\n\n0\n\n20.0\n\n(c)\n\n2\n\n4\n\n6\n\n8\n\nInjected Anomaly Fraction (%)\n\n10\n\n(d)\n\nFigure 11: A reproduction of Fig. 3 including the Maximum Mean Discrepancy (MMD) and Fréchet\nInception Distance (FID) baselines for the JetClass (a), LIGO (b), Histology (c), and CIFAR-10 (d)\ndatasets.\n\n27\n\n\fCIFAR, 5.0% Signal Injection, f ker = q99\nAsymptotic NPLM ( ker = q99)\nEmpirical NPLM ( ker = q99)\nMahalanobis (Empirical)\nSupervised\n\n8\n\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\nJetClass, 1.0% Signal Injection, ker = q50\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n14\n12\n\nZ Score ( )\n\nZ Score ( )\n\n10\n6\n\n4\n\n10\n\nLIGO, 4.0% Signal Injection, ker = 2q99\nAsymptotic NPLM ( ker = 2q99)\nEmpirical NPLM ( ker = 2q99)\nMahalanobis (Empirical)\nSupervised\n\n8\n\nZ Score ( )\n\n10\n\n8\n6\n\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n6\n\n4\n\n4\n2\n\n2\n2\n\n0\n\n5\n\n10\n\n15\n\n20\n\n25\n\n30\n\nContrastive Embedding Dimension\n\n0\n\n5\n\n10\n\n15\n\n20\n\n25\n\n0\n\n30\n\nContrastive Embedding Dimension\n\n(a)\n\n5\n\n10\n\n15\n\n20\n\n25\n\n30\n\nContrastive Embedding Dimension\n\n(b)\n\n(c)\n\nFigure 12: Z score as a function of embedding dimension for NPLM and baseline anomaly detection\nmethods in the CIFAR-10 (a), JetClass (b), and LIGO (c) datasets. The best-performing kernel widths\nare chosen for presentation, and signal injection fractions are set such that NPLM has good but not\nfully-saturated sensitivity at the d = 4 baseline.\n\nJetClass, 1.0% Signal Injection, ker = q50\n14\n12\n\nZ Score ( )\n\n10\n\nAsymptotic NPLM ( ker = q50)\nEmpirical NPLM ( ker = q50)\nMahalanobis (Empirical)\nSupervised\nIdeal Supervised\nMMD (Empirical)\nFrechet (Empirical)\n\n8\n6\n4\n2\n00\n\n2\n\n4\n\n6\n\nTraining Label Noise (%)\n\n8\n\n10\n\nFigure 13: Z score as a function of label noise (%) dimension for NPLM and baseline anomaly\ndetection methods for the JetClass dataset. The best-performing kernel widths are chosen for\npresentation, and signal injection fractions are set such that NPLM has good but not fully-saturated\nsensitivity at the zero-noise baseline.\n\nof the test highly depends on the threshold set on the one-class output score. With a threshold that\nallows for 10% false positive rate, the one-class SVM performs comparably to the NPLM version.\nThe one-class SVM has no discriminative power when the threshold is set to 1% false positive rate,\ncorresponding to a more subtle anomalous contribution. The reason for such variance is the fact that\nin the latent representation, the anomaly does not necessarily lie outside the distribution. Additional\ntests run on the astronomy data (where the signal highly overlaps with one of the background classes)\nshow an even more striking example of detection failure.\nIn conclusion, these studies reassure our strategy of using the NPLM to compute a two-sample test\nrather than focusing on out-of-distribution detection because two-sample tests are sensitive to a wider\nrange of anomalous behavior. This is particularly relevant for the histology data since more than one\nanomalous tile is expected per sample, and capturing collective behaviors enables the detection of\nmore subtle anomalies, e.g., to detect diseases manifesting in tissue earlier.\n28\n\n\fD\n\nDiscriminating CIFAR-10.1 and CIFAR-5m\n\nTo further demonstrate the capabilities of AutoSciDACT for detecting distributional shifts, we\napply it to the problem of quantifying the difference between CIFAR-10 and the synthetic CIFAR5m dataset [66], as well as the independently curated CIFAR-10.1 dataset [120]. CIFAR-5m was\ndiscussed in the main text and App. A, and consists of approximately 5 million images generated by a\ndiffusion model trained on CIFAR-10. CIFAR-10.1 was introduced in [120], where it was specifically\ncollected and curated to be as close to CIFAR-10 as possible (e.g. drawing from similar sources of\nimages). The idea was to test whether classifiers trained on CIFAR-10 readily generalized to data\noutside of CIFAR-10 but in principle distributionally identical. It was found that performance dropped\nsubstantially when evaluating on CIFAR-10, indicating some non-trivial shift in the dataeset. Recent\nwork in Liu et. al. [121] and Guille-Escuret et. al. [13] has applied some versions of two-sample tests\nto distinguish CIFAR-10 and CIFAR-10.1, both showing strong evidence of a distributional shift\nbetween the two.\nIn Fig. 14 we tackle this question with AutoSciDACT. We train a four-dimensional contrastive\nembedding on the full CIFAR-10 training dataset without holding out any classes, as individual\nclasses are not considered anomalous in this context. We use the same architecture and training\nprocedure as for the CIFAR-10 results in the main text. We use this encoder to embed the CIFAR-10m\ntest set, the CIFAR-10.1 set, and 100,000 randomly selected images from the CIFAR-5m set with the\nsame class proportions as CIFAR-10 test and CIFAR-10.1. We run 500 NPLM pseudo experiments for\neach of the six kernel widths σ = [0.1, 1.5, 2.6, 3.6, 4.9, 9.8] to produce the following distributions\nof test statistics:\n1. Null hypothesis: in each experiment R is composed of 8500 randomly sampled CIFAR-10\ntest set images, and D from the remaining 1500.\n2. CIFAR-10.1: in each experiment R is composed of 8500 randomly sampled CIFAR-10 test\nset images, and D from 1500 randomly sampled CIFAR-10.1 images.\n3. CIFAR-5m: in each experiment R is composed of 8500 randomly sampled CIFAR-10 test\nset images, and D from 1500 randomly sampled CIFAR-5m images.\nDistributions of the NPLM test statistic for each scenario and each kernel width are plotted in\nFig. 14, with the corresponding asymptotic and empirical Z scores for CIFAR-10.1 and CIFAR-5m\nrelative to the CIFAR-10-only null hypothesis indicated in the legends. Even the smallest and worstperforming kernel σ = 0.1 distinguishes CIFAR-10.1 from CIFAR-10 at the 2.2σ level, while the\nremaining larger kernels distinguish it extremely easy beyond even the 10σ level. This indicates a\nclear distributional shift between CIFAR-10 and CIFAR-10.1, and presents one of the first (to our\nknowledge) statistically rigorous quantifications of this discrepancy.\nThe discrepancy between CIFAR-10 and CIFAR-5m is notably much smaller, saturating near 2.3σ for\nthe best performing kernels. This is exactly in line with what one would expect, given that CIFAR-5m\nis generated from a diffusion model trained on CIFAR-10. A well-trained diffusion model is able to\nmodel its training distribution exceedingly accurately, and the relatively small deviation we observe\nhere underscores this fact. More interestingly, this hints at an unexpected but fascinating potential\nuse case for AutoSciDACT as a method for evaluating the quality of generative models.\n\nE\n\nSearching for the Higgs boson in LHC Data\n\nTo demonstrate how AutoSciDACT might be used in a more realistic setting, we use it to search for\nevidence of the Higgs boson (H) in a dataset of real proton-proton collision data collected by the\nCompact Muon Solenoid (CMS) experiment at the Large Hadron Collider (LHC). We specifically\ntarget the four-lepton final-state, where the Higgs boson decays to four electrons, four muons, or\ntwo electrons and two muons (pp → H → e+ e− e+ e− , µ+ µ− µ+ µ− , or µ+ µ− e+ e− ). The Higgs\nboson was discovered through the observation of an excess in predominantly these final states and\nthe di-photon final state [122, 123], with Higgs-like events isolated using hand-tuned selections\non physics-motivated variables that were reconstructed from observed data. Here, we replace the\nmajority of this selection with the AutoSciDACT pipeline, keeping only a loose \"pre-selection\" of\nevents designed to suppress large, well-known background processes.\n29\n\n\f140\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 0.1\n\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 0.44, Zemp = 0.53\nCIFAR-10.1\nZasymp = 2.25, Zemp = 2.26\n\n120\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 1.5\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 2.32, Zemp = 2.41\nCIFAR-10.1\nZasymp = 10.78, Zemp = 2.88\n\n120\n100\n\nCounts\n\nCounts\n\nCounts\n\n100\n\n60\n\n40\n20\n\n20\n060\n\n80\n\n100\n\n120\n\n140\n\ntNPLM\n\n160\n\n180\n\n200\n\n0\n\n220\n\n20\n100\n\n150\n\n(a)\n\n150\n\n300\n\n350\n\n0 50\n\n400\n\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 2.28, Zemp = 2.14\nCIFAR-10.1\nZasymp = 12.43, Zemp = 2.88\n\n200\n175\n\n50\n\n25\n\n25\n150\n\n200\n\ntNPLM\n\n(d)\n\n250\n\n300\n\n350\n\n0\n\n300\n\n350\n\n400\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 9.8\n\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 2.30, Zemp = 2.26\nCIFAR-10.1\nZasymp = 12.96, Zemp = 2.88\n\n250\n\n100\n\n75\n\n50\n\n250\n\ntNPLM\n\nCounts\n\nCounts\n\n75\n\n200\n\n150\n\n100\n\n100\n\n150\n\n200\n\n125\n\n100\n\n50\n\n100\n\n(c)\n\n150\n\n125\n\nCounts\n\n250\n\ntNPLM\n\n(b)\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 2.28, Zemp = 2.33\nCIFAR-10.1\nZasymp = 11.91, Zemp = 2.88\n\n175\n\n200\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 4.9\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 3.6\n\n0\n\n80\n60\n\n40\n\n40\n\nReference (CIFAR-10)\nCIFAR-5m\nZasymp = 2.33, Zemp = 2.33\nCIFAR-10.1\nZasymp = 11.32, Zemp = 2.88\n\n120\n\n80\n\n60\n\nNPLM: CIFAR-10 vs. CIFAR-5m, CIFAR-10.1, ker = 2.6\n\n140\n\n100\n80\n\n160\n\n50\n\n50\n\n100\n\n150\n\n200\n\ntNPLM\n\n250\n\n300\n\n350\n\n00\n\n50\n\n100\n\n(e)\n\n150\n\ntNPLM\n\n200\n\n250\n\n300\n\n(f)\n\nFigure 14: NPLM tests comparing CIFAR-10 to CIFAR-5m and CIFAR-10.1 using a four dimensional\ncontrastive embedding. The reference is built from the CIFAR-10 test set, and test stastics for the\nnull hypothesis are shown in gray. Test statistics comparing against CIFAR-5m are shown in red,\nwhile those comparing against CIFAR-10.1 are shown in blue. Panels (a)-(f) corresponding to the six\ndifferent NPLM kernel widths σ = [0.1, 1.5, 2.6, 3.6, 4.9, 9.8].\nWe run AutoSciDACT on both real and simulated events from the CMS Open Data [124] for 2011\nand 2012. We impose a similar data pre-selection to the standard CMS search, requiring at least 4\nwell-identified and loosely isolated electrons or muons with transverse momenta (pT ) greater than 5\nGeV, the most energetic of which (\"leading lepton\") having pT &gt; 20 GeV. Additionally, we require\none opposite-sign pair of electrons or muons with invariant mass (mℓ+ ℓ− ) greater than 12 GeV. In the\nfirst stage of AutoSciDACT, we pre-train the contrastive encoder using simulated events from the\ndominant background processes (Z boson pair production with decays to the 4e, 4µ, and 2e2µ final\nstates). The encoder is a small MLP that takes as input the full kinematic information (px , py , pz , E)\nand particle ID (electron or muon) of the four leptons in the event, for a total of 20 inputs. As in the\nmain paper, we train a four-dimensional embedding space.\nIn the search phase, we follow the standard procedure for CMS data analysis and compute expected\np-values based on simulated data, then measure the observed p-value in real data. Expected p-values\nare computed empirically by running many toys for the background-only and background + Higgs\nhypotheses to obtain distributions of a test statistic (either the NPLM test statistic or one obtained\nfrom a direct fit to the four-lepton invariant mass, see below). For each NPLM toy, we sample\nthe reference (R) and observed (D) datasets from simulated background events, adding additional\nsimulated Higgs events to D for toys under the background + signal hypothesis. Finally, a single test\nstatistic is computed using the true data (i.e. observed in CMS), and the observed p-value is computed\nrelative to the test statistic for background-only toys.\nWe perform three different tests using the statistical procedure described above:\n• Baseline Discovery We assume full knowledge of the Higgs boson, and perform a onedimensional hypothesis test using the single most discriminating variable: the four-lepton\ninvariant mass m4ℓ . The Higgs boson signal should manifest itself as a localized \"bump\" or\npeak in a histogram of observed m4ℓ at m4ℓ = mH (approximately 125 GeV). We construct\n30\n\n\f4D Contrastive Space, with Higgs\n\nM4 Fit\n80\n\np(exp) = 0.06\np(obs) = 0.098\n\n70\n60\n50\n40\n\nToys, Sim. Bkg Only\nToys, Sim. Bkg + Sig\nobserved\n\n80\n\nToys\n\n30\n20\n\n60\n\np(exp) = 0.056\np(obs) = 0.01\n\n40\n20\n\n10\n0\n\n1\n\n0\n\n1\n\n2\n\nLog( )\n\n3\n\n4\n\n0\n\n5\n\n10\n\n20\n\n30\n\n(a)\n\np(exp) = 0.162\np(obs) = 0.116\n\n100\n75\n50\n\n0.6\n\n1.00\n0.5\n\nData\nMedium Anomaly Score Cut\nTight Anomaly Score Cut\n\n0.4\n\n25\n0\n\n10\n\n20\n\n30\n\nNPLM Score\n\n10.00\n\n0.7\n\nAnomaly Score\n\nToys\n\n125\n\n4D Contrastive Space\n\n0.8\n\nToys, Sim. Bkg Only\nToys, Sim. Bkg + Sig\nobserved\n\n150\n\n50\n\n(b)\n\n4D Contrastive Space\n175\n\n40\n\nNPLM Score\n\nExpected Background Yield (Sim)\n\nToys\n\nToys, Sim. Bkg Only\nToys, Sim. Bkg + Sig\nobserved\n\n40\n\n0.3\n\n(c)\n\n80\n\n100\n\n120\n\nMass(GeV)\n\n140\n\n160\n\n0.10\n\n(d)\n\nFigure 15: Top row: test-statistic distributions for simulated background-only (blue) (orange) simulated background + Higgs signal (orange), along with observed test statistic (red), for a direct fit\nto m4ℓ (left) and AutoSciDACT with Higgs included in training (right). Bottom left: Expected\nand observed test statistics/p-values for vanilla AutoSciDACT trained without knowledge of the\nHiggs. Bottom right: Distributions of m4ℓ versus AutoSciDACT NPLM anomaly score in simulated\nbackgrounds (filled) and observed data (points), where the most anomalous observed data lies near\nthe true Higgs mass (125 GeV).\n\nbackground-only (B) and signal (S) m4ℓ histogram shape templates using simulated events,\nthen fit the observed m4ℓ histogram to the background-only (B) or signal + background\n(S + B) hypotheses. The statistical significance of an observation is then computed from the\ndelta log-likelihood test statistic obtained from the two fits: ∆ log L = log LS+B − log LB .\nWe view this as the baseline sensitivity for discovery.\n• AutoSciDACT NPLM We run NPLM on the four-dimensional embedding space obtained\nfrom the contrastive encoder. We expect the presence of domain shift between the simulated\nand observed data (i.e. mis-modeling) to somewhat weaken the sensitivity of discovery.\n• Supervised AutoSciDACT NPLM We re-train our contrastive encoder with simulated Higgs\nevents included in the training set, so that it explicitly learns about the signal of interest. The\nHiggs signal should be well-separated from backgrounds in the learned embedding space,\nso we expect sensitivity in this case to be on par with the baseline obtained from the m4ℓ fit.\nWe present results from our analysis in Fig. 15. The top row shows expected test statistic distributions\nand expected/observed p-values for the baseline (left) and supervised AutoSciDACT (right) methods.\nBoth methods achieve similar expected performance, with the observed p-values differing somewhat\nin either direction due to known domain shifts between simulated and real LHC data. These shifts lead\nto a larger spread in observed p-values, and given that we are not properly accounting for systematic\nuncertainties in our analysis, they have a noticeable effect. The expected p-values are thus more\n31\n\n\finformative, as they provide a clear impression of how effectively each method finds a Higgs signal\nwithout the impact of domain shift.\nFigure 15(c) shows results using standard AutoSciDACT (i.e. a contrastive space trained without\nknowledge of the Higgs). As expected, it is somewhat less sensitive than the baseline methods.\nHowever, even the baselines do not achieve highly significant p-values, largely due to the small\ndataset size and the fact that we only consider one Higgs decay mode8 To better interpret these\nresults, in Fig. 15(d) we plot two-dimensional distributions of m4ℓ versus NPLM anomaly score\nfor simulated backgrounds (filled) and observed data (points). We observe that the most anomalous\npoints in real data are clustered near 120-130 GeV, near the known mass of the Higgs (125 GeV). We\ndraw two horizontal lines depicting example medium/tight thresholds on the NPLM score, showing\nhow these Higgs-like events could be isolated in a dataset by selecting on anomaly score. Note that a\nfull analysis using this selection would likely increase sensitivity, since it would use both the 4-lepton\nmass and the anomaly score.\n\nF\n\nEmbedding Space Visualizations\n\nFor reference, we include visualizations of the four-dimensional contrastive embedding spaces for\nthe CIFAR-10, JetClass, LIGO, and histology datasets in Figure 16.\n\n8\n\nThe expected significance in this channel was only ∼ 2σ in the original CMS paper [122], with discovery\nclaimed only by combining results from several channels.\n\n32\n\n\fAirplane\nBird\nCat\nDeer\nDog\n\nFrog\nHorse\nShip\nTruck\nAutomobile\n\nQCD\nTop\n\n(a)\n\nW qq\nZ qq\nH bb\n\n(b)\n\nBrain\nLung\nHeart\nPancreas\nKidney\nSpleen\nLiver\nLiver (rat)\nLiver Disease\n\nSineGaussian\nKink\nBBH\nKinkKink\nGaussian\nBackground\nCusp\nGlitches\nWhite Bursts\n\n(c)\n\n(d)\n\nFigure 16: Corner plots showing the four-dimensional contrastive embedding spaces for CIFAR-10\n(a), JetClass (b), histology (c), and LIGO (d). The turqoise clusters correspond to the classes used in\ntraining the encoder, and the pink cluster shows the distribution of \"anomalous\" signal in the learned\nspace.\n\n33\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"