"<!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.21449v1 [cs.CV] 24 Oct 2025\n\nMoniTor: Exploiting Large Language Models\nwith Instruction for Online Video Anomaly Detection\n\nShengtian Yang* , Yue Feng* , Yingshi Liu, Jingrou Zhang, Jie Qin†\nCollege of Artificial Intelligence, Nanjing University of Aeronautics and Astronautics\nKey Laboratory of Brain-Machine Intelligence Technology, Ministry of Education, China\n\nAbstract\nVideo Anomaly Detection (VAD) aims to locate unusual activities or behaviors\nwithin videos. Recently, offline VAD has garnered substantial research attention,\nwhich has been invigorated by the progress in large language models (LLMs)\nand vision-language models (VLMs), offering the potential for a more nuanced\nunderstanding of anomalies. However, online VAD has seldom received attention due to real-time constraints and computational intensity. In this paper, we\nintroduce a novel Memory-based online scoring queue scheme for Training-free\nVAD (MoniTor), to address the inherent complexities in online VAD. Specifically,\nMoniTor applies a streaming input to VLMs, leveraging the capabilities of pretrained large-scale models. To capture temporal dependencies more effectively,\nwe incorporate a novel prediction mechanism inspired by Long Short-Term Memory (LSTM) networks. This ensures the model can effectively model past states\nand leverage previous predictions to identify anomalous behaviors. Thereby, it\nbetter understands the current frame. Moreover, we design a scoring queue and an\nanomaly prior to dynamically store recent scores and cover all anomalies in the\nmonitoring scenario, providing guidance for LLMs to distinguish between normal\nand abnormal behaviors over time. We evaluate MoniTor on two large datasets\n(i.e., UCF-Crime and XD-Violence) containing various surveillance and real-world\nscenarios. The results demonstrate that MoniTor outperforms state-of-the-art methods and is competitive with weakly supervised methods without training. Code is\navailable at https://github.com/YsTvT/MoniTor.\n\n1\n\nIntroduction\n\nVideo Anomaly Detection (VAD) aims to locate abnormal activities or behaviors in videos, which is\ncrucial for video understanding applications [16, 12, 10, 11]. However, existing VAD methods [1,\n47, 41, 7] are mostly in an offline fashion, ignoring the demands for real-time monitoring and realworld applications, which also play an important role in many real-life scenarios, such as intelligent\nsurveillance [14, 15, 18, 37, 17], autonomous driving [4], etc.\nCompared to offline VAD, anomaly detection can be further complicated in scenarios where data\narrive in a streaming/online manner, especially when it is required to identify anomalies as they\noccur. The difficulties lie in, moreover, the inherent characteristics of online anomalies, because they\nare discontinuous and occur infrequently in real scenarios, which results in a scarcity of extensive\nand diverse anomaly data for training. Moreover, the high complexity of human behaviors (i.e.,\n*\n†\n\nEqual contribution.\nCorresponding author.\n\n39th Conference on Neural Information Processing Systems (NeurIPS 2025).\n\n\fCaption: ‘A man tries to\nget into a gate, and then\nclimbs over a fence. A dog\nis seen running through the\ngate.’\nCaption with score 0.4: ‘A\nman attempted to enter a\ngate and walked by it. A\ndog walked by the fence\nand ran through the gate.\nThe man was captured\nclimbing over the\nfence.’ ……\nPrediction: ‘The dog\nchases a man as he\nattempts to flee through\nthe gate.’\nAnomaly Score : 0.5\n\nAbuse\n\nCaption: ‘A man entered a\nstore, pointed at a door.\nHe shot at the door and\nkicked it in.’\nCaption with score 1.0: ‘A\nman was seen pointing at a\ndoor. He then shot at the\ndoor, kicked it in, and\nentered the store.’ ……\nPrediction: ‘Man flees\nstore, shots fired outside.’\nAnomaly Score : 1.0\n\nRobbery\n\nCaption: ‘A man uses his\ncell phone at a gas station,\nthen sets fire to a gas pump,\nrepeatedly, for several\nmoments.’\n\nCaption: ‘A group of\npeople are fighting in a\nsubway station, with the\nscene repeating multiple\ntimes.’\n\nCaption with score 0.8:\n‘A man used his cell\nphone at a gas pump, and\nthen two men stood at the\ngas station. One of the\nmen set fire to the gas\npump, and the act was\ncaptured on surveillance\ncamera multiple\ntimes.’……\nPrediction: ‘Two men flee\nthe scene as flames engulf\nthe gas pump.’\nAnomaly Score : 0.9\n\nCaption with score 0.7:\n‘A group of people are\nfighting in a subway\nstation. At some point, a\nvideo of people walking on\nthe subway is shown. The\nfighting continues in the\nsubway station.’ ……\nPrediction: ‘Fights\nescalate, causing\npassengers to flee the\nsubway station.’\nAnomaly Score : 0.7\n\nExplosion\n\nFighting\n\nFigure 1: Illustration of MoniTor which detects abnormal events across multiple surveillance perspectives. MoniTor identifies critical security incidents: Abuse, Robbery, Explosion, Fighting and so on.\n\nencompassing a vast array of both normal and abnormal actions) poses obstacles to the generalizability of VAD models in real-world settings. Current datasets fail to comprehensively capture\nthe diversity of human behaviors. This significantly limits the VAD model’s generalization ability\nacross different domains and scenarios. For example, Karim et al. [21] introduced REWARD, a\nweakly-supervised framework for real-time anomaly detection. Although trained as an end-to-end\nvideo model, REWARD struggles with dynamic camera angles and complex scenes due to limited\ntraining data, which limits its applicability across diverse scenarios. Recent VAD solutions have\nalso been devoted to tackling these challenges with pretrained large-scale models. Zanella et al. [50]\nproposed LAVAD, a training-free VAD approach utilizing Large Language Models (LLMs) to score\npotential anomalies directly from text, thus bypassing data collection and annotation. However,\nLAVAD is limited to offline VAD, as applying LLMs to online VAD faces additional challenges.\nCapturing historical information for anomaly scoring may lead to model misinterpretation when\nanomalous memories are encountered in normal videos. In addition, LLMs’ reliance on explicit\ninstructions impedes their ability to genuinely identify anomalous events.\nIn this paper, we propose a novel Memory-based online scoring queue scheme for Training-free VAD,\nnamely MoniTor, to solve the above challenges. As shown in Fig. 1, our MoniTor can precisely\nand efficiently identify various abnormal events. Firstly, we introduce a hierarchical dual-memory\narchitecture through Dynamic Memory Gating Module that systematically addresses temporal discontinuity inherent in online anomalies. This architecture integrates a long-term episodic memory\nmodule with adaptive forgetting mechanisms and a short-term working memory encoding fine-grained\nspatiotemporal patterns. Through this dual-memory design, we effectively tackle the challenge of\ndiscontinuous and infrequent anomaly occurrences in real scenarios. Secondly, we formulate a\nprincipled anomaly scoring protocol via Standard Scoring Queue that incorporates a novel queuing\nmechanism for sequential anomaly descriptor propagation. This protocol leverages a knowledgeenhanced anomaly prior derived from encyclopedic sources. Such design significantly expands the\nmodel’s generalization capacity across diverse anomalous events, addressing the obstacles posed by\nboth the high complexity of human behaviors and the limitations of available datasets. Thirdly, we\npropose a predictive scoring framework in Behavior Prediction and Dynamic Analysis component\nthat exploits temporal causality in streaming video. This framework establishes a feedback loop\nbetween expectation and reality, improving detection sensitivity for emergent anomalies despite their\nstochastic and infrequent manifestation. Consequently, our approach effectively mitigates the scarcity\nof extensive and diverse anomaly data for training. Moreover, we conduct rigorous experimental\nvalidation on challenging benchmark datasets, i.e., UCF-Crime [38] and XD-Violence [48]. Our\ncomprehensive analysis demonstrates that MoniTor significantly outperforms state-of-the-art online\nunsupervised approaches and offline training-free methods across multiple evaluation metrics. These\nresults empirically validate that our framework effectively captures temporal context and facilitates\n2\n\n\frobust anomaly comprehension in LLMs, overcoming the significant restrictions on VAD models’\neffectiveness beyond specific datasets.\nIn summary, our contributions are four-fold:\n• We introduce MoniTor, which applies Large Language Models (LLMs) for online VAD. Our\nMoniTor facilitates real-time monitoring through streaming video inputs, with the notable\ncapability of generating anomaly scores at 0.6-second intervals while maintaining a 5-second\nend-to-end processing latency.\n• We integrate the Long Short-Term Memory (LSTM) networks with LLMs to effectively\nencode historical sequence information, which enhances the performance of online VAD\nand makes the identification of anomalous event boundaries more precisely.\n• We propose an innovative scoring queue mechanism to mitigate the challenges associated\nwith instruction dependency within LLMs. Furthermore, we introduce an anomaly prior,\nwhich is instrumental in training LLMs to effectively discern anomalous events.\n• Extensive experiments demonstrate that our proposed MoniTor achieves superior performance compared to unsupervised approaches and surpasses training-free offline methods.\n\n2\n\nRelated work\n\nOnline VAD. In general, VAD is as an out-of-distribution detection problem and uses training data\nof different supervision levels to learn normal distribution, including full supervision (i.e., framelevel supervision of normal video and abnormal video) [3, 44, 8, 1, 35, 29], weak supervision\n(i.e., video-level monitoring of normal video and abnormal video) [20, 24, 38], one-class (i.e., only\nnormal video) [26, 30, 32] and unsupervised (i.e., unlabeled video) [31, 49, 53]. Video anomaly\ndetection is categorized into online and offline fashion in the area of computer vision [19]. Most\nof the existing work on offline VAD has made great breakthroughs. However, in real life, to avoid\ncrime, we need to detect anomalies in the video in a timely manner. In the early research of online\nVAD, Chaker et al. [6] constructed a spatio-temporal cuboid using a window-based method to achieve\nonline anomaly detection and localization. Luo et al. [28] and Wang et al. [46] encoded motion and\nappearance with LSTM Auto-Encoder. Recently, inspired by the dense video captioning streaming\nmodel which does not require access to all input frames proposed by Zhou et al. [54], Rossi et al. [35]\nproposed MOVAD equipped with two main components: a Short-Term Memory Module (STMM)\nand a Long-Term Memory Module (LTMM) to process past and current frames for online VAD tasks.\nHowever, existing online VAD models exhibit certain limitations. Some fail to effectively capture\nhistorical information, while others may produce scores that are skewed by misleading historical data.\nLLM-based VAD. Recently, with the emergence of powerful LLMs such as GPT [2, 5, 33] and\nLlama [42, 43], several notable VAD approaches have leveraged these models. Kim et al.[22] employed ChatGPT for textual descriptors coupled with VLM-based anomaly detection, while Zanella\net al.[50] pioneered a training-free paradigm using Llama-2 [43] to generate anomaly scores from\nBLIP-2 [23] frame descriptions. However, current LLM-based VAD approaches exhibit fundamental limitations: they lack robust contextual reasoning capabilities for temporal reasoning in video\nsequences and demonstrate high sensitivity to prompt engineering, resulting in inconsistent performance when instructions are ambiguous. Despite these constraints, LLMs offer crucial advantages\nover traditional approaches that require exhaustive domain-specific training. Specifically, LLMs\nenable effective domain adaptation without data collection overhead or retraining, making them\nparticularly suitable for diverse, cross-domain deployment scenarios. Our approach addresses these\nlimitations through two key technical innovations: (1) an LSTM-based forgetting gate mechanism\nthat selectively preserves temporal context while eliminating irrelevant information, and (2) a novel\nscoring queue architecture that provides structured guidance to the LLM, substantially enhancing its\ndecision-making precision in dynamic environments. Consequently, we present MoniTor, the first\nonline training-free VAD framework that effectively leverages LLMs for real-time anomaly detection\nwith robust temporal reasoning capabilities.\n\n3\n\nMethod\n\nOverview. The overall framework of our method is shown in Fig. 2. Specifically, after a frame is\nextracted from the untrimmed video, it is fed into the Online Visual-Language Model to generate\n3\n\n\fOnline Vision-Language Model\n\nAnomaly Priors Integration\nAnomaly Priors\n\nArrest\n\n1\n\nUpdate\n\nDynamic Memory Gating Module\nLong-term\n\n…\n\nVandalism\n\nOutput\n\n0.2\n…\n\nD\n\n…\n\nCleaning caption\n\nCaptions\n\n0.1\n\n…\n\n…\n\nRaw caption\n\n…\n\n…\n\nExtracted frames\n\nAbuse\n\nStandard Scoring Queue\n\nScores\n\n0\n\nWeight Assignment\n\n��−�\n\nShort-term\n\n…\n\nCosine\nSimilarity\n\n��\n\nLLM\n\nLLM\n\n1-α Update\n\nα\n\n�\n\nBehavior Prediction and Dynamic Analysis\n…\n\nForgetting\nGate\n\nLLM\n\nD\n\n: VAD Dataset\n\nsummary\n\nsummary\n\n+\n\nMemory\n\n: Caption of last two frames\n\nPrediction\n\n: Caption of last ten frames\n\nFrame 0\n\nFrame 16\n\nL\n\nCaption of\nT=16\nL\n\nFrame 32\n\nCaption of\nT=32\nL\n\n: Above the threshold`\n\nFrame 48\n\nCaption of\nT=48\n\n: Below the threshold\n\nFigure 2: The architecture of our MoniTor: (1) Online Vision-Language Model (Sec. 3.1) is used to\nget each frame’s textual summary. (2) Anomaly Priors Integration (Sec. 3.2) is used to serve as a\nform of “knowledge injection”. (3) Dynamic Memory Gating Module (Sec. 3.3) is used to capture\nhistorical information while preventing the large model from being misled by historical memory.\n(4) Behavior Prediction and Dynamic Analysis (Sec. 3.4) leverages frame-to-frame predictive cues\nto facilitate robust anomaly detection through comparative analysis of temporal discrepancies. (5)\nStandard Scoring Queue (Sec. 3.5) is used to guide the large model on how to identify and understand\nanomalies. (6) Score Optimization and Weight Assignment (Sec. 3.6) adjusts LLMs’ scoring results\nbased on different context, better aiding LLMs in distinguishing abnormal behaviors.\n\na textual summary. Then, the Anomaly Priors Integration is employed to guide the LLM to better\nunderstand the concept of anomalous events. To fully integrate historical information, the Dynamic\nMemory Gating Module respectively summarizes captions of long-term and short-term historical\nframes and pass them to the LLM. Meanwhile, the Behavior Prediction and Dynamic Analysis\nModule is applied to guide the LLM in generating a prediction for the caption of the next frame,\nwhich is passed to LLM when processing the next frame. Moreover, the Standard Scoring Queue is\nemployed to store the corresponding historical frames for each score, and the anomaly score predicted\nby the LLM is used for updating the scoring queue.\n\n3.1\n\nOnline Vision-Language Model\n\nOnline Vision-Language Model is proposed to transform video frames online into their corresponding\ntextual descriptions as LAVAD [50]. In this module, we first use five BLIP-2 models to generate five\nraw captions Ri = {Ri1 , Ri2 , Ri3 , Ri4 , Ri5 } for the current frame Ii . However, the raw captions\nmay be noisy. To mitigate this problem, we make full use of historical information. For each raw\ncaption Aj in A = Ri ∪ Ri−1 ∪ Ri−2 ∪ Ri−3 ∪ Ri−4 ∪ Ri−5 , we compute the cosine similarity\nXj between its text feature and the image feature of the frame:Xj = ⟨EI (Ii ) · ET (Aj )⟩, where ⟨·, ·⟩\nis the cosine similarity, EI is the image encoder of ImageBind, and ET is the textual encoder of\nImageBind. Afterthat, we sort all raw captions Aj in A by the cosine similarity Xj and select the\ntop 10 as cleaning captions Ci = {A1 , A2 , . . . , A10 }. Finally, we send the cleaning captions Ci\ninto GLM-4-Flash to get the summary: Si = ΦGLM (PS ◦ Ci ), where prompt PS is formed as “Please\nsummarize what happened in few sentences, based on the following temporal description of a scene.\"\n◦ is text concatenation. ΦGLM refers to generating summary through GLM-4-Flash.\n4\n\n\f3.2\n\nAnomaly Priors Integration\n\nIn this module, since UCF-Crime and XD-Violence contain 13 and 6 categories of anomalies in\nsurveillance scenarios, respectively, they cover a wide range of possible offences. We intend to\ninclude anomaly priors PA in context prompt to guide LLMs in recognizing anomalies and paying\nattention to them. We guide LLMs by adding the definitions of these anomalies from Wikipedia to\nthe context prompt and giving examples as appropriate.\n3.3\n\nDynamic Memory Gating Module\n\nThis module is based on the LSTM architecture, capturing both long-term memory (Ml ) and shortterm memory (Ms ). A forgetting gate is used to ensure the model accurately represents the input\nremoving noise. Long-term memory (Ml ) maintains a summary of text descriptions from frames over\na 10-frame window, denoted as Si = {Si−10 , Si−9 , . . . , Si−1 }. These frames are filtered through the\nforgetting gate (F ), which evaluates the similarity between the current and past frames. Frames with\na similarity above a threshold θ are retained for summarization. The long-term memory is updated as:\nMl = ΦGLM (Dl ),\n\u001a\nDl =\n\nD1 + Si−j ,\nD1 ,\n\nif di−j &gt; θ\nif di−j ≤ θ\n\n(1)\nj = 1, 2, . . . , 10\n\n(2)\n\ndi−j = ⟨ET (Si ), ET (Si−j )⟩,\n(3)\nwhere ⟨·, ·⟩ represents cosine similarity, and the textual encoder ET : T → Z maps text to vector\nspace representations. The value di−j is the cosine similarity between frames Si and Si−j , and Dl is\nthe long-term memory storage filtered by the forgetting gate. j serves as the index for traversing from\nthe current frame back to the previous 10 frames.\nIn contrast, short-term memory (Ms ) summarizes the most recent two frames, Si−1 and Si−2 ,\nproviding a more immediate representation of recent context. The short-term memory is updated by\nMs = ΦGLM (Ds ), where Ds contains the text descriptions from the two previous frames.\n3.4\n\nBehavior Prediction and Dynamic Analysis\n\nIn this section, we focus on enhancing the model’s ability to predict behavior and perform dynamic\nanalysis by leveraging summarized information from both long-term and short-term memory. An\nLSTM-based architecture is utilized due to its effectiveness in analyzing sequential data, making it\nparticularly suited for behavior prediction in video sequences. This approach also plays a critical\nrole in the model’s scoring phase. The prediction is obtained by: P2 = ΦGLM (Pp ◦ Si ◦ Ppf ), where\nSi represents the summary of the current frame, and P2 is the prediction for the next frame based\non the current frame. The prediction step occurs within the scoring phase of the prior step. The\ncomponent Pp is designed to prompt, “If you are a law enforcement agency, predict what might\nhappen next in this scene, taking into account possible suspicious activities or behaviors such as\nabuse, arrests, arson, assault, burglary, disorderly conduct, explosions, fights, robbery, shootings,\ntheft, or vandalism. Provide a concise prediction based on the current context.” Ppf is structured to\nprompt,“Please predict concisely the behavior or event likely to occur next in the scene, avoiding any\nadditional explanations.” This approach allows for a precise and targeted assessment of potential\nbehaviors in dynamic video sequences, optimizing the model’s scoring and analytical capabilities.\n3.5\n\nStandard Scoring Queue\n\nIn this module, we implement a dynamic scoring system for LLMs, which helps guide the model to\ngenerate high-quality outputs based on predefined evaluation criteria. To achieve this, we maintain a\nscoring queue Q = {Q0 , Q0.1 , . . . , Q1 }, where each element Qi represents the most recent caption\nthat received a score of i. The scoring queue serves as a repository of these anomaly assessments,\nenabling real-time updates and comparisons. It is updated as follows: Qai−1 = Si−1 , where ai−1\nrepresents the anomaly score of the i − 1 frame, and Si−1 denotes the text description of the i − 1\nframe. The equation indicates that the summary of the i − 1 frame Si−1 is stored at the corresponding\nposition Qai−1 in the queue based on its anomaly score ai−1 , which is used to record and track the\nanomaly detection result at that specific time and provide LLMs with guidance on scoring.\n5\n\n\f3.6\n\nScore Optimization and Weight Assignment\n\nIn our approach, we implement a dynamic weight assignment strategy to adaptively balance the\nimportance of the current frame’s score with the score of the previous frame. This mechanism enables\nthe model to respond to changes in the video sequence while preserving continuity based on prior\nframes. By doing so, the model can gradually adjust to new information in each frame without\nabruptly discarding the historical context provided by earlier frames.\nThe weight assignment process is structured as follows: for each frame in a batch, the score is\ncomputed by combining the current frame’s score with the score of the previous frame, ensuring a\nweighted contribution from both. This balance is controlled by a parameter α, which determines\nthe proportion of influence from the current and previous frames. The weighted score is defined by:\nãi = α × ai + (1 − α) × ai−1 , here, ãi represents the adjusted score for the current frame i, ai is\nthe raw score of the current frame, and ai−1 is the score of the previous frame. The parameter α\n(where 0 ≤ α ≤ 1) controls the weighting between the two scores, allowing for flexible adaptation\nto dynamic changes in the video sequence while still considering the past context. This approach\nenhances the model’s capability to perform smooth and contextually aware behavior prediction across\nvideo frames. Finally, the entire score is summarized by:\nai = ΦGLM (P1 ◦ Ml ◦ Ms ◦ Q ◦ PA ◦ Si ),\n\n(4)\n\nwhere ai represents the anomaly score of the current frame before weight assignment, derived from\na combination of behavior prediction, long-term and short-term memory, scoring queue, anomaly\npriors, and the frame summary. This structured approach empowers the model to distinguish between\nnormal and abnormal behaviors effectively, leveraging both temporal and contextual cues to enhance\nanomaly detection accuracy in video sequences.\n\n4\n\nExperiments\n\n4.1\n\nExperimental Settings\n\nDatasets. We evaluate our method using two frequently used VAD datasets: UCF-Crime [38] and\nXD-Violence [48]. UCF-Crime contains 1900 long untrimmed real-world surveillance videos, which\nencompass 13 anomaly categories of anomalous events. We use the test set containing 290 videos\nincluding 150 normal videos and 140 anomalous videos. XD-Violence consists of 4754 YouTube and\nmovie videos for violent incident detection, categorized into 6 types of anomalies. We evaluate on an\n800-video test set, using only visual content to ensure fair assessment.\nEvaluation metrics. For the UCF-Crime dataset, following previous works [38, 52, 9], we use the\nArea Under the Curve (AUC) of the frame-level Receiver Operating Characteristic (ROC) curve as\nthe evaluation metric to measure the classifier’s ability to distinguish between normal and abnormal\nvideo clips. For the XD-Violence dataset, following the established evaluation protocol in [48], we\nalso use the Area under the frame-level Precision-recall curve (AP).\nImplementation details. First, as Zanella et al. [50] do, we use BLIP-2 [23] to generate textual\ndescriptions each frame and use ImageBind to get the cleaned captions. Then, we use GLM-4-Flash\nto summarize the cleaned captions and perform subsequent scoring, ensuring no future information\nleakage. We can get an anomaly score within 5∼6s. The α in the weight assignment is set to 0.7, the\ntemperature in the LLMs is set to 0.6, and the threshold θ in the forgetting gate is set to 0.5. We set\nthe number of video parallel calculations, i.e., num_jobs, to 190 and run the program on two NVIDIA\nGeForce RTX 4090 GPUs.\n4.2\n\nComparison with State-of-The-Art Works\n\nWe compare MoniTor with SOTA methods including offline one-class VAD [38, 45], online weakly\nsupervised VAD [47, 41, 7, 21], offline unsupervised VAD [27, 49, 40, 31, 39], and offline trainingfree VAD [23, 34, 13, 25, 51, 50, 36]. The methods S3R [47], RTFM [41], MGFN [7] were originally\noffline, and we used the online detection results from [21] for them. The results on UCF-Crime are\nall shown in Tab. 1. Our method outperforms all previous offline unsupervised and one-class method,\nand even outperforms offline training-free VAD. Our method achieves an absolute gain of 2.29% and\n0.54% in AUC when using the same ViT video features.\n6\n\n\fTable 1: Comparison with state-of-the-art of- Table 2: Comparison with state-of-the-art offline\nfline one-class, online weakly-supervised, offline one-class, online weakly-supervised, offline unsuunsupervised, and offline training-free video pervised, and offline training-free video anomaly\nanomaly detection methods on UCF-Crime. ZS detection methods on XD-Violence. ZS IB refers\nIB refers to ZS ImageBind [13].\nto ZS ImageBind [13].\nModel\n\nBackbone\n\nAUC(%)\n\nModel\n\nOffline One-class Video Anomaly Detection\nSVM Baseline [38]\nBOGS [45]\nGODS [45]\n\nI3D\nI3D\n\nBackbone\n\nAP(%) AUC(%)\n\nOffline One-class Video Anomaly Detection\n\n50.00\n68.26\n70.46\n\nSVM Baseline [38]\nBOGS [45]\nGODS [45]\n\nI3D\nI3D\n\n-\n\n50.78\n57.32\n61.56\n\nOnline Weakly Supervised Video Anomaly Detection\n\nOnline Weakly-Supervised Video Anomaly Detection\n\nS3R [47]\nRTFM [41]\nMGFN [7]\nREWARD [21]\n\nS3R [47]\nRTFM [41]\nMGFN [7]\nREWARD [21]\n\nI3D\nI3D\nI3D\nUniformer-32\n\n81.34\n80.63\n81.76\n86.94\n\nOffline Unsupervised Video Anomaly Detection\nLu et al. [27]\nGCL [49]\nTur [31]\nDyAnNet [39]\n\nC3D-RGB\nResNeXt\nResNet\nI3D\nViT\nViT\nViT\nViT\nViT\nViT\nViT\nViT\n\n65.51\n71.04\n66.85\n79.76\n\nRareanom [40]\n\nViT\nViT\n\n-\n\nI3D-RGB\n\n-\n\n68.33\n\nOffline Training-free Video Anomaly Detection\nBlip2 [23]\nZS CLIP [34]\nZS IB (Image) [13]\nZS IB (Video) [13]\nLLAVA-1.5 [25]\nVideo-Llama2 [51]\nLAVAD [50]\nEventVAD [36]\n\n46.42\n53.16\n53.65\n55.78\n72.84\n74.42\n80.28\n82.03\n\nViT\nViT\nViT\nViT\nViT\nViT\nViT\nViT\n\n10.89\n17.93\n27.25\n25.36\n50.26\n53.57\n60.02\n64.04\n\n29.43\n38.21\n58.81\n55.06\n79.62\n80.21\n82.89\n87.51\n\nOnline Training-free Video Anomaly Detection\nonline-LAVAD [50]\nOurs\n\nOnline Training-free Video Anomaly Detection\nonline-LAVAD [50]\nOurs\n\n70.14\n72.60\n73.17\n77.71\n\nOffline Unsupervised Video Anomaly Detection\n\nOffline Training-free Video Anomaly Detection\nBlip2 [23]\nZS CLIP [34]\nZS IB (Image) [13]\nZS IB (Video) [13]\nLLAVA-1.5 [25]\nVideo-Llama2 [51]\nLAVAD [50]\nEventVAD [36]\n\nI3D\nI3D\nI3D\nUniformer-32\n\nViT\nViT\n\n52.63\n55.01\n\n76.01\n79.11\n\n76.06\n82.57\n\nTable 3: Comparison of decision period, processing time, and decision delay.\nDecision periods(s) Processing time(s) Delay(s)\nREWARD[21]\n\n6.4\n\n0.5\n\n6.9\n\nOurs\n\n0.6\n\n5.9\n\n6.5\n\nSpecifically, we introduce a LAVAD-based[50] baseline where we generate anomaly scores for each\nframe using the same context prompts and Vision Language Model as we did after removing the\nglobal information. LAVAD uses five BLIP-2 [23] models and ImageBind model as the vision\nlanguage model, and uses Llama2-7B for the summarization and scoring process. Compared with\nonline LAVAD, we achieve a higher AUC, with a significant improvement of 6.51%. As can be seen,\nour MoniTor does a good job of capturing historical information and guiding the LLMs. What’s\nmore, we also improve on offline one-class and offline unsupervised VAD by 12.11% and 2.81%\nrespectively. And our method is comparable to online weakly supervised VAD. More details about\nthe baseline model are in the appendix.\nWhat’s more, as depicted in Tab. 2, we also achieve a gain of 2.38% in AP and 3.10% in AUC\non XD-Violence dataset. Analysing the tiny improvement on XD-Violence dataset, we think our\nMoniTor is attributed to surveillance scenery, but there are plenty of camera transitions in the XDViolence dataset, which reduces the effectiveness of our Dynamic Memory Gating Module and the\nBehavior Prediction and Dynamic Analysis module. However, it still outperforms offline one-class\n7\n\n\fContext Format. Caption with score 0.1:\n‘A large crowd of people are sitting in a\nmall. ’. Long-term: ‘A mall is filled with\npeople, some in blue shirts.’. Short-term:\n‘A mall is filled with a crowd, some in blue\nshirts.’. Prediction: ‘No previous frame\navailable for prediction.’\n\nContext Format. Caption with score 0.1: ‘A\nbus driver is seen in the video. The bus has seats\nand a camera inside.’. Long-term: ‘A bus driver\nis filmed as his bus bursts into flames.’. Shortterm: ‘A bus is engulfed in flames, with fire on\nthe seats.’. Prediction: ‘Passengers are jumping\nout of the windows, screaming for help.’\n\nContext Format. Caption with score\n0.5: ‘A young man is talking to a\nwoman in a dark room.’. Long-term:\n‘A pair of red-haired men and women\ntalk in the dark room.’. Short-term:\n‘A woman and a young man converse\nin the dark room.’. Prediction: ‘The\nwoman and the man start to walk\naway together, holding hands.’\n\nContext Format. Caption with score 0.5:\n‘A man in glasses was standing in a bar\nwith people around him.’ Long-term: ‘A\nman in glasses drinks beer in a bar where a\nfight erupts.’. Short-term: ‘A bar fight\ninjures a man in glasses.’. Prediction: ‘The\ninjured man is helped up by friends, and the\nwoman on the pool table watches the\ncommotion.’\n\nFigure 3: We present qualitative results of our MoniTor on test videos. For each video, we graph the\nanomaly scores across the frames by our approach. Alongside this, we show keyframes with their\ncorresponding temporal summaries, in which blue bounding boxes denote normal frames and red for\nthose deemed anomalous—thus showcasing the correlation between the anomaly scores, the visual\ncontent, and their descriptions. Notably, the ground-truth anomalies are highlighted.\n0240\n\n0480\n\n0672\n\n0016\n\n0400\n\n0720\n\nFigure 4: We present real-world tests using MoniTor. For each video, we graph the anomaly scores\nacross the frames by our approach. Alongside this, we show keyframes, in which blue bounding boxes\ndenote normal frames and red for those deemed anomalous—thus showcasing the correlation between\nthe anomaly scores and the visual content. Notably, the ground-truth anomalies are highlighted.\n\nand unsupervised VAD, and is competitive to offline training-free VAD. MoniTor is a challenging\nyet innovative task, although it performs slightly lower than traditional weakly supervised methods\nin some cases. However, 1) its key advantage is handling scenarios with data collection challenges\nor privacy concerns, offering a training-free solution. 2) The performance differences stem from\nbackbone variations. Other methods employ video-level VAD to process video segments and thus\ncapture both spatial and temporal data, offering a performance edge. In contrast, our frame-level\nVAD focuses on individual frames and lacks temporal context, limiting its performance. Despite this,\nMoniTor is valuable where traditional methods are not feasible.\nQualitative results. Fig. 3 shows qualitative results of MoniTor with videos from UCF-Crime and\nXD-Violence. In the abnormal videos (Column 1), the anomaly scores remain consistently low when\neverything is normal, but show significant improvement in abnormal parts, indicating that MoniTor\naccurately identifies and locates abnormal segments present in the videos. In the normal videos\n(Column 2), the anomaly scores remain consistently low in the entire video, showing that MoniTor\ndoes not wrongly identify any normal events as anomalies thanks to its dedicated design.\n8\n\n\fTable 4: Ablation study of MoniTor on UCFCrime, evaluating the impact of different key\ncomponents. W: weight assignment, S: Standard\nScoring Queue, A: Anomaly Priors Integration,\nM: Dynamic Memory Gating Module, P: Behavior Prediction and Dynamic Analysis.\nW\n\nS\n\nA\n\nM\n\nP\n\nAUC(%)\n\n✗\n✓\n✗\n✗\n✗\n✗\n✓\n\n✗\n✗\n✓\n✗\n✗\n✗\n✓\n\n✗\n✗\n✗\n✓\n✗\n✗\n✓\n\n✗\n✗\n✗\n✗\n✓\n✗\n✓\n\n✗\n✗\n✗\n✗\n✗\n✓\n✓\n\n76.06\n77.02\n78.65\n77.85\n78.88\n78.30\n82.57\n\nTable 5: Ablation study of the Dynamic Memory Gating Module on MoniTor, evaluating the\nimpact of long-term memory, short-term memory, and forgetting gate. Long-Term: Long Term\nMemorym, Short-Term: Short-Term Memory,\nForgetting Gate.\nLong-Term Short-Term Forgetting Gate AUC(%)\n✓\n✗\n✓\n✓\n\n✗\n✓\n✗\n✓\n\n✗\n✗\n✓\n✓\n\n78.27\n77.92\n78.66\n78.88\n\nComputational efficiency. As shown in Table 3, compared with existing methods, MoniTor has better\nreal-time performance by effectively capturing and selecting historical information. MoniTor achieves\nan anomaly score within 5∼6 seconds per frame, with a decision period of 0.6 seconds—significantly\nfaster than the general online VAD standard of 30 seconds. MoniTor demonstrates a substantial improvement in decision period, processing time, and decision delay compared to REWARD, indicating\nits suitability for real-time applications. Please refer to the appendix for more details.\nReal-world tests. As shown in Fig. 4, we also evaluate our MoniTor using random YouTube videos\nto detect anomalies in real-world scenarios. These real-world tests allow us to assess and confirm\nthe method’s real-time performance capabilities. We perform these tests by searching for keywords\nassociated with anomalies on YouTube and selecting specific videos, such as those depicting gun\nrobberies and physical altercations. Results indicate that MoniTor accurately identifies anomalies\nacross diverse settings and effectively differentiates normal activities from those in the video stream.\nConsequently, these tests verify the generalization capabilities of MoniTor and its efficacy for realtime safety surveillance applications. More real-world test cases are available in the appendix.\n4.3\n\nAblation Study\n\nIn this section, we present the ablation study on the proposed MoniTor. By progressively ablating\neach key component, we analyze its contribution.\nEffect of key components. In this study, as Tab. 4 shows, we integrate individual modules to test\nthe anomaly detection performance on UCF-Crime. The Anomaly Priors module improved AUC\nby 1.79%, providing LLMs with prior knowledge to better differentiate anomalies. Then, Dynamic\nMemory Gating module, which improved performance by 2.82%, dynamically regulates memory\naccess to enhance the model’s understanding of temporal dependencies. The Standard Scoring\nQueue, resulting in a 2.59% AUC increase, leverages historical scoring data to guide LLMs in\nanomaly detection. The Behavior Prediction and Dynamic Analysis module boosted AUC by 2.24%,\nenhancing the model’s ability to identify complex and subtle anomalies. Finally, Weight Assignment,\nby prioritizing current scores, led to a 0.96% AUC improvement, demonstrating its effectiveness in\nmomentum allocation for anomaly detection. Collectively, these modules significantly improve the\ndetection accuracy and robustness. More ablation studies are available in our appendix.\nEffect of forgetting gate and memory. As Tab. 5 shows, this ablation study investigates the effect of\ndifferent memory components: Long-Term Memory, Short-Term Memory, and the Forgetting Gate,\non model performance in terms of AUC. By enabling and disabling these components individually\nand in combination, we aim to understand the contribution of each component to the model’s overall\nanomaly detection capabilities. The performances of the long-term memory, short-term memory, and\nforgetting gate modules are 78.27%, 77.92%, and 78.66% on AUC, respectively, each showing a\n1∼2% improvement over the baseline, which highlights the effectiveness of each module. Analyzing\nthe reasons for this improvement, the long-term memory module effectively captures historical\ninformation but can sometimes be influenced by irrelevant captions, leading to less precise anomaly\nscores. To address this, we introduced the forgetting gate, which filters out unimportant captions,\nresulting in a further AUC increase of 0.39%. Additionally, the short-term memory module captures\n9\n\n\fthe previous two captions (approximately 1 second), enhancing the consistency of the anomaly score\nby maintaining immediate contextual relevance.\n\n5\n\nConclusions\n\nIn this paper, we propose MoniTor to tackle the difficulties in online VAD, which leverages VLM\nand instructs LLM to obtain anomaly scores through a training-free scheme. MoniTor is the first to\nusing large-scale models for training-free online VAD, which includes the following main modules.\nWe first extract anomaly priors from datasets and Wikipedia. At the same time, a scoring queue\nis maintained to teach LLM the scoring rules and help recognize anomalous events. To capture\nhistorical information well, we propose Dynamic Memory Gating Module to get long-term memory\nand short-term memory while filtering irrelevant information. Moreover, the Behavior Prediction\nand Dynamic Analysis module is introduced to predict abnormal patterns, enhancing LLM’s ability\nto distinguish anomalies from their context. Finally, the obtained anomaly scores are fed into the\nWeight Assignment module to get the coherent scores. We evaluate MoniTor on UCF-Crime and\nXD-Violence. It achieves SOTA on the standard VAD datasets, and demonstrates competitive results\ncompared to weakly supervised methods. We also have real-world tests, which verify the effectiveness\nand generalization ability of MoniTor.\n\n6\n\nLimitations and Future Work\n\nDespite strong performance in online VAD, MoniTor faces two practical challenges. First, abrupt\ncamera transitions disrupt our Dynamic Memory Gating Module, with roughly 60% of detection\nerrors occurring around scene changes. This happens because the system loses its established\nunderstanding of scene context and anomaly patterns when camera perspectives shift suddenly.\nSecond, real-world deployment on resource-constrained edge devices poses difficulties. Our reliance\non LLMs and VLMs requires substantial computational resources, which becomes problematic\nfor devices with limited memory and processing capabilities. Addressing the camera transition\nissue may benefit from continual learning techniques like Experience Replay, which could help the\nsystem maintain contextual understanding across scene changes. For deployment constraints, model\ncompression approaches including quantization and pruning offer potential paths toward efficient realtime processing on edge devices with smaller memory footprints. These directions, while requiring\ndeparture from our current training-free paradigm in some cases, represent natural extensions that\ncould broaden the practical applicability of LLM-based anomaly detection in real-world surveillance\nscenarios.\n\nAcknowledgements\nThis work was partially supported by the National Natural Science Foundation of China (No.\n62276129), the Natural Science Foundation of Jiangsu Province (No. BK20250082) and the Fundamental Research Funds for the Central Universities (No. NE2025010).\n\n10\n\n\fReferences\n[1] Armstrong Aboah, Maged Shoman, Vishal Mandal, Sayedomidreza Davami, Yaw Adu-Gyamfi,\nand Anuj Sharma. A vision-based system for traffic anomaly detection using deep learning and\ndecision trees. In 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition\nWorkshops (CVPRW), pages 4202–4207, 2021. doi: 10.1109/CVPRW53098.2021.00475.\n[2] Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni\nAleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4\ntechnical report. arXiv preprint arXiv:2303.08774, 2023.\n[3] Shuai Bai, Zhiqun He, Yu Lei, Wei Wu, Chengkai Zhu, Ming Sun, and Junjie Yan. Traffic\nanomaly detection via perspective map based on spatial-temporal information matrix. In\nProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)\nWorkshops, June 2019.\n[4] Daniel Bogdoll, Jan Imhof, Tim Joseph, and J. Marius Zöllner. Hybrid video anomaly detection\nfor anomalous scenarios in autonomous driving. CoRR, abs/2406.06423, 2024.\n[5] Tom B Brown. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.\n[6] Rima Chaker, Zaher Al Aghbari, and Imran N Junejo. Social network model for crowd anomaly\ndetection and localization. Pattern Recognition, 61:266–281, 2017.\n[7] Yingxian Chen, Zhengzhe Liu, Baoheng Zhang, Wilton Fok, Xiaojuan Qi, and Yik-Chung\nWu. MGFN: Magnitude-Contrastive Glance-and-Focus Network for Weakly-Supervised Video\nAnomaly Detection. arXiv e-prints, art. arXiv:2211.15098, November 2022. doi: 10.48550/\narXiv.2211.15098.\n[8] Keval Doshi and Yasin Yilmaz. Online anomaly detection in surveillance videos with asymptotic\nbound on false alarm rate. Pattern Recognition, 114:107865, June 2021. doi: 10.1016/j.patcog.\n2021.107865.\n[9] Jia-Chang Feng, Fa-Ting Hong, and Wei-Shi Zheng. Mist: Multiple instance self-training\nframework for video anomaly detection. In Proceedings of the IEEE/CVF conference on\ncomputer vision and pattern recognition, pages 14009–14018, 2021.\n[10] Yue Feng, Zhengye Zhang, Rong Quan, Limin Wang, and Jie Qin. Refinetad: Learning proposalfree refinement for temporal action detection. In Proceedings of the 31st ACM International\nConference on Multimedia, MM ’23, page 135–143, New York, NY, USA, 2023. Association\nfor Computing Machinery. ISBN 9798400701085. doi: 10.1145/3581783.3611872. URL\nhttps://doi.org/10.1145/3581783.3611872.\n[11] Shiping Ge, Zhiwei Jiang, Yafeng Yin, Cong Wang, Zifeng Cheng, and Qing Gu. Learning\nevent-specific localization preferences for audio-visual event localization. In Proceedings\nof the 31st ACM International Conference on Multimedia, MM ’23, page 3446–3454, New\nYork, NY, USA, 2023. Association for Computing Machinery. ISBN 9798400701085. doi:\n10.1145/3581783.3612506. URL https://doi.org/10.1145/3581783.3612506.\n[12] Shiping Ge, Qiang Chen, Zhiwei Jiang, Yafeng Yin, Liu Qin, Ziyao Chen, and Qing Gu. Implicit\nlocation-caption alignment via complementary masking for weakly-supervised dense video\ncaptioning, 2025. URL https://arxiv.org/abs/2412.12791.\n[13] Rohit Girdhar, Alaaeldin El-Nouby, Zhuang Liu, Mannat Singh, Kalyan Vasudev Alwala,\nArmand Joulin, and Ishan Misra. Imagebind: One embedding space to bind them all. In\nProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages\n15180–15190, 2023.\n[14] Satoshi Hashimoto, Alessandro Moro, Kenichi Kudo, Takayuki Takahashi, and Kazunori Umeda.\nUnsupervised video anomaly detection in traffic and crowded scenes. In SII, pages 870–876.\nIEEE, 2022.\n11\n\n\f[15] Satoshi Hashimoto, Alessandro Moro, Kenichi Kudo, Takayuki Takahashi, and Kazunori Umeda.\nUnsupervised video anomaly detection in traffic and crowded scenes. In SII, pages 870–876.\nIEEE, 2022.\n[16] Wei Ji, Jingjing Li, Cheng Bian, Zongwei Zhou, Jiaying Zhao, Alan L Yuille, and Li Cheng.\nMultispectral video semantic segmentation: A benchmark dataset and baseline. In Proceedings\nof the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1094–1104,\n2023.\n[17] Yizhen Jia, Rong Quan, Haiyan Chen, Jiamei Liu, Yichao Yan, Song Bai, and Jie Qin. Disaggregation distillation for person search. IEEE Transactions on Multimedia, 27:158–170, 2025.\ndoi: 10.1109/TMM.2024.3521732.\n[18] Yizhen Jia, Rong Quan, Yue Feng, Haiyan Chen, and Jie Qin. Doubly contrastive learning\nfor source-free domain adaptive person search. Proceedings of the AAAI Conference on\nArtificial Intelligence, 39(4):3949–3957, Apr. 2025. doi: 10.1609/aaai.v39i4.32413. URL\nhttps://ojs.aaai.org/index.php/AAAI/article/view/32413.\n[19] Runyu Jiao, Yi Wan, Fabio Poiesi, and Yiming Wang. Survey on video anomaly detection in\ndynamic scenes with moving cameras. arXiv e-prints, art. arXiv:2308.07050, August 2023. doi:\n10.48550/arXiv.2308.07050.\n[20] Hyekang Kevin Joo, Khoa Vo, Kashu Yamazaki, and Ngan Le. CLIP-TSA: CLIP-Assisted\nTemporal Self-Attention for Weakly-Supervised Video Anomaly Detection. arXiv e-prints, art.\narXiv:2212.05136, December 2022. doi: 10.48550/arXiv.2212.05136.\n[21] Hamza Karim, Keval Doshi, and Yasin Yilmaz. Real-time weakly supervised video anomaly\ndetection. In Proceedings of the IEEE/CVF winter conference on applications of computer\nvision, pages 6848–6856, 2024.\n[22] Jaehyun Kim, Seongwook Yoon, Taehyeon Choi, and Sanghoon Sull. Unsupervised video\nanomaly detection based on similarity with predefined text descriptions. Sensors, 23(14), 2023.\nISSN 1424-8220. doi: 10.3390/s23146256. URL https://www.mdpi.com/1424-8220/23/\n14/6256.\n[23] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image\npre-training with frozen image encoders and large language models. In International conference\non machine learning, pages 19730–19742. PMLR, 2023.\n[24] S. Li, Fang Liu, and Licheng Jiao. Self-training multi-sequence learning with transformer for\nweakly supervised video anomaly detection. In AAAI Conference on Artificial Intelligence,\n2022. URL https://api.semanticscholar.org/CorpusID:248982052.\n[25] Haotian Liu, Chunyuan Li, Yuheng Li, and Yong Jae Lee. Improved baselines with visual\ninstruction tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, pages 26296–26306, 2024.\n[26] Zhian Liu, Yongwei Nie, Chengjiang Long, Qing Zhang, and Guiqing Li. A hybrid video\nanomaly detection framework via memory-augmented flow reconstruction and flow-guided\nframe prediction. In Proceedings of the IEEE/CVF international conference on computer vision,\npages 13588–13597, 2021.\n[27] Cewu Lu, Jianping Shi, and Jiaya Jia. Abnormal event detection at 150 fps in matlab. In\nProceedings of the IEEE international conference on computer vision, pages 2720–2727, 2013.\n[28] Weixin Luo, Wen Liu, and Shenghua Gao. Remembering history with convolutional lstm for\nanomaly detection. In 2017 IEEE International Conference on Multimedia and Expo (ICME),\npages 439–444, 2017. doi: 10.1109/ICME.2017.8019325.\n[29] Weixin Luo, Wen Liu, Dongze Lian, Jinhui Tang, Lixin Duan, Xi Peng, and Shenghua Gao.\nVideo anomaly detection with sparse coding inspired deep neural networks. IEEE Transactions\non Pattern Analysis and Machine Intelligence, 43(3):1070–1084, 2021. doi: 10.1109/TPAMI.\n2019.2944377.\n12\n\n\f[30] Hui Lv, Chen Chen, Zhen Cui, Chunyan Xu, Yong Li, and Jian Yang. Learning normal\ndynamics in videos with meta prototype network. In Proceedings of the IEEE/CVF conference\non computer vision and pattern recognition, pages 15425–15434, 2021.\n[31] Anil Osman Tur, Nicola Dall’Asen, Cigdem Beyan, and Elisa Ricci. Unsupervised Video\nAnomaly Detection with Diffusion Models Conditioned on Compact Motion Representations.\narXiv e-prints, art. arXiv:2307.01533, July 2023. doi: 10.48550/arXiv.2307.01533.\n[32] Hyunjong Park, Jongyoun Noh, and Bumsub Ham. Learning Memory-Guided Normality\nfor Anomaly Detection . In 2020 IEEE/CVF Conference on Computer Vision and Pattern\nRecognition (CVPR), pages 14360–14369, Los Alamitos, CA, USA, June 2020. IEEE Computer\nSociety. doi: 10.1109/CVPR42600.2020.01438. URL https://doi.ieeecomputersociety.\norg/10.1109/CVPR42600.2020.01438.\n[33] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al.\nLanguage models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.\n[34] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal,\nGirish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual\nmodels from natural language supervision. In International conference on machine learning,\npages 8748–8763. PMLR, 2021.\n[35] Leonardo Rossi, Vittorio Bernuzzi, Tomaso Fontanini, Massimo Bertozzi, and Andrea Prati.\nMemory-augmented online video anomaly detection. In ICASSP 2024 - 2024 IEEE International\nConference on Acoustics, Speech and Signal Processing (ICASSP).\n[36] Yihua Shao, Haojin He, Sijie Li, Siyu Chen, Xinwei Long, Fanhu Zeng, Yuxuan Fan, Muyang\nZhang, Ziyang Yan, Ao Ma, Xiaochen Wang, Hao Tang, Yan Wang, and Shuyan Li. EventVAD:\nTraining-Free Event-Aware Video Anomaly Detection. arXiv e-prints, art. arXiv:2504.13092,\nApril 2025. doi: 10.48550/arXiv.2504.13092.\n[37] Liangxu Su, Rong Quan, Zhiyuan Qi, and Jie Qin. Maca: Memory-aided coarse-to-fine\nalignment for text-based person search. In Proceedings of the 47th International ACM SIGIR\nConference on Research and Development in Information Retrieval, pages 2497–2501, 2024.\n[38] Waqas Sultani, Chen Chen, and Mubarak Shah. Real-world Anomaly Detection in Surveillance\nVideos. arXiv e-prints, art. arXiv:1801.04264, January 2018. doi: 10.48550/arXiv.1801.04264.\n[39] Kamalakar Thakare, Yash Raghuwanshi, Debi Prosad Dogra, Heeseung Choi, and Ig-Jae Kim.\nDyAnNet: A Scene Dynamicity Guided Self-Trained Video Anomaly Detection Network. arXiv\ne-prints, art. arXiv:2211.00882, November 2022. doi: 10.48550/arXiv.2211.00882.\n[40] Kamalakar Vijay Thakare, Debi Prosad Dogra, Heeseung Choi, Haksub Kim, and Ig-Jae Kim.\nRareanom: A benchmark video dataset for rare type anomalies. Pattern Recognition, 140:\n109567, 2023. ISSN 0031-3203. doi: https://doi.org/10.1016/j.patcog.2023.109567. URL\nhttps://www.sciencedirect.com/science/article/pii/S0031320323002674.\n[41] Yu Tian, Guansong Pang, Yuanhong Chen, Rajvinder Singh, Johan W Verjans, and Gustavo\nCarneiro. Weakly-supervised video anomaly detection with robust temporal feature magnitude\nlearning. In Proceedings of the IEEE/CVF international conference on computer vision, pages\n4975–4986, 2021.\n[42] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open\nand efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.\n[43] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei,\nNikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open\nfoundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.\n[44] Gaoang Wang, Xinyu Yuan, Aotian Zheng, Hung-Min Hsu, and Jenq-Neng Hwang. Anomaly\ncandidate identification and starting time estimation of vehicles from traffic videos. In CVPR\nWorkshops, 2019. URL https://api.semanticscholar.org/CorpusID:198181168.\n13\n\n\f[45] Jue Wang and Anoop Cherian. Gods: Generalized one-class discriminative subspaces for\nanomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer\nVision (ICCV), October 2019.\n[46] Lin Wang, Fuqiang Zhou, Zuoxin Li, Wangxia Zuo, and Haishu Tan. Abnormal event detection\nin videos using hybrid spatio-temporal autoencoder. In 2018 25th IEEE International Conference\non Image Processing (ICIP), pages 2276–2280, 2018. doi: 10.1109/ICIP.2018.8451070.\n[47] Jhih-Ciang Wu, He-Yen Hsieh, Ding-Jie Chen, Chiou-Shann Fuh, and Tyng-Luh Liu. Selfsupervised sparse representation for video anomaly detection. In European Conference on\nComputer Vision, pages 729–745. Springer, 2022.\n[48] Peng Wu, Jing Liu, Yujia Shi, Yujia Sun, Fangtao Shao, Zhaoyang Wu, and Zhiwei Yang. Not\nonly look, but also listen: Learning multimodal violence detection under weak supervision. In\nComputer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020,\nProceedings, Part 16, pages 322–339. Springer, 2020.\n[49] M Zaigham Zaheer, Arif Mahmood, M Haris Khan, Mattia Segu, Fisher Yu, and Seung-Ik Lee.\nGenerative cooperative learning for unsupervised video anomaly detection. In Proceedings of\nthe IEEE/CVF conference on computer vision and pattern recognition, pages 14744–14754,\n2022.\n[50] Luca Zanella, Willi Menapace, Massimiliano Mancini, Yiming Wang, and Elisa Ricci. Harnessing large language models for training-free video anomaly detection. In Proceedings of the\nIEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 18527–18536, June\n2024.\n[51] Hang Zhang, Xin Li, and Lidong Bing. Video-llama: An instruction-tuned audio-visual language\nmodel for video understanding, 2023. URL https://arxiv.org/abs/2306.02858.\n[52] Jiangong Zhang, Laiyun Qing, and Jun Miao. Temporal convolutional network with complementary inner bag loss for weakly supervised anomaly detection. In 2019 IEEE International\nConference on Image Processing (ICIP), pages 4030–4034. IEEE, 2019.\n[53] Bin Zhao, Li Fei-Fei, and Eric P. Xing. Online detection of unusual events in videos via dynamic\nsparse coding. In CVPR 2011, pages 3313–3320, 2011. doi: 10.1109/CVPR.2011.5995524.\n[54] Xingyi Zhou, Anurag Arnab, Shyamal Buch, Shen Yan, Austin Myers, Xuehan Xiong, Arsha\nNagrani, and Cordelia Schmid. Streaming Dense Video Captioning. arXiv e-prints, art.\narXiv:2404.01297, April 2024. doi: 10.48550/arXiv.2404.01297.\n\n14\n\n\fNeurIPS Paper Checklist\n1. Claims\nQuestion: Do the main claims made in the abstract and introduction accurately reflect the\npaper’s contributions and scope?\nAnswer: [Yes]\nJustification: We have summarized our paper’s contributions and scope in the abstract and\nintroduction.\n2. Limitations\nQuestion: Does the paper discuss the limitations of the work performed by the authors?\nAnswer: [Yes]\nJustification: We claim our limitations in our the appendix.\n3. Theory assumptions and proofs\nQuestion: For each theoretical result, does the paper provide the full set of assumptions and\na complete (and correct) proof?\nAnswer: [NA]\nJustification: We do not have any theoretical results in the paper.\n4. Experimental result reproducibility\nQuestion: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions\nof the paper (regardless of whether the code and data are provided or not)?\nAnswer: [Yes]\nJustification: We thoroughly explain the details of implementation.\n5. Open access to data and code\nQuestion: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental\nmaterial?\nAnswer: [Yes]\nJustification: We will release our code and dataset in our project page upon acceptance.\n6. Experimental setting/details\nQuestion: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the\nresults?\nAnswer: [Yes]\nJustification: We clarified experimental setting/datails in Implementation Details section.\n7. Experiment statistical significance\nQuestion: Does the paper report error bars suitably and correctly defined or other appropriate\ninformation about the statistical significance of the experiments?\nAnswer: [Yes]\nJustification: The paper report error bars suitably and correctly defined or other appropriate\ninformation about the statistical significance of the experiments.\n8. Experiments compute resources\nQuestion: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce\nthe experiments?\nAnswer: [Yes]\nJustification: We discuss the compute efficiency in our Experiment section and the appendix.\n9. Code of ethics\n15\n\n\fQuestion: Does the research conducted in the paper conform, in every respect, with the\nNeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?\nAnswer: [Yes]\nJustification: This work complies with the NeurIPS Code of Ethics.\n10. Broader impacts\nQuestion: Does the paper discuss both potential positive societal impacts and negative\nsocietal impacts of the work performed?\nAnswer: [Yes]\nJustification: We discuss the importance of our MoniTor in timely monitoring anomalous\nevents in society, which has great significance for human social security.\n11. Safeguards\nQuestion: Does the paper describe safeguards that have been put in place for responsible\nrelease of data or models that have a high risk for misuse (e.g., pretrained language models,\nimage generators, or scraped datasets)?\nAnswer: [NA]\nJustification: This work does not pose such risks.\n12. Licenses for existing assets\nQuestion: Are the creators or original owners of assets (e.g., code, data, models), used in\nthe paper, properly credited and are the license and terms of use explicitly mentioned and\nproperly respected?\nAnswer: [Yes]\nJustification: The code and data used have been properly cited or referenced.\n13. New assets\nQuestion: Are new assets introduced in the paper well documented and is the documentation\nprovided alongside the assets?\nAnswer: [NA]\nJustification: The paper does not release new assets.\n14. Crowdsourcing and research with human subjects\nQuestion: For crowdsourcing experiments and research with human subjects, does the paper\ninclude the full text of instructions given to participants and screenshots, if applicable, as\nwell as details about compensation (if any)?\nAnswer: [NA]\nJustification: The paper does not involve crowdsourcing nor research with human subjects.\n15. Institutional review board (IRB) approvals or equivalent for research with human\nsubjects\nQuestion: Does the paper describe potential risks incurred by study participants, whether\nsuch risks were disclosed to the subjects, and whether Institutional Review Board (IRB)\napprovals (or an equivalent approval/review based on the requirements of your country or\ninstitution) were obtained?\nAnswer: [NA]\nJustification: The paper does not involve crowdsourcing nor research with human subjects.\n16. Declaration of LLM usage\nQuestion: Does the paper describe the usage of LLMs if it is an important, original, or\nnon-standard component of the core methods in this research? Note that if the LLM is used\nonly for writing, editing, or formatting purposes and does not impact the core methodology,\nscientific rigorousness, or originality of the research, declaration is not required.\nAnswer: [Yes]\nJustification: The use of LLMs in implementing the method has been described in the\nexperimental setup section.\n\n16\n\n\fAppendix\nIn this appendix, we first provide more implementation details about the baseline model in Sec. A.\nThen, we provide a discussion on online definition in Sec. B. Moreover, we give more ablations in\nSec. C, including prompt sensitivity analysis (Sec. E), initialization strategy studies addressing the\ncold-start problem (Sec. F), video length performance analysis (Sec. G), and comprehensive failure\ncase examination (Sec. H). Sec. D shows more analysis for real-world tests. Finally, Sec. I presents a\ncritical examination of the proposed method’s limitations and outlines promising directions for future\nresearch that address the fundamental challenges in online video anomaly detection systems.\n\nA\n\nImplementation Details of Baseline Model\n\nAbout the baseline model used for ablation study, which is also shown in the main text as the\nonline-LAVAD method, we here give more implementation details. In detail, we first process the\ntexts through cleaning and summarization procedures as described in [50], then input them into\nGLM-4-Flash for scoring. Since it is online and cannot use global information, we directly use the\nfinal score as the anomaly score for evaluation, similar to MoniTor, achieving 76.06%.\n\nB\n\nDefinition of Online VAD\n\nVideo anomaly detection (VAD) is a critical task in surveillance systems and smart city applications,\nrequiring the identification of irregular events within video streams. Current approaches can be\ncategorized into offline and online methods. Offline methods utilize complete video sequences and\noften achieve high accuracy through global temporal reasoning, but face significant deployment\nconstraints due to latency requirements. In contrast, online VAD aims to detect anomalies in streaming\nvideos with minimal processing delay, without accessing future frames.\nExisting online VAD approaches [47, 41, 7, 21] typically process multi-frame segments as detection\nunits, creating an inherent trade-off between detection accuracy and latency: longer segments\nimprove contextual understanding but increase detection delay. Our approach fundamentally differs\nby operating at the individual frame level through a novel stream sampling strategy, which maintains\ntemporal context while enabling consistent, predictable decision periods. This frame-level processing\nparadigm eliminates the variable latency issues present in segment-based methods while preserving\ndetection performance, making our method particularly suitable for time-critical applications where\nconsistent response time is essential.\n\nC\n\nMore Ablation Studies\n\nThe effect of key modules. We conduct more ablation studies to demonstrate the effectiveness of\nthe core components of our model: Weight Assignment, Standard Scoring Queue, Anomaly Priors\nIntegration, Dynamic Memory Gating Module, and Behavior Prediction and Dynamic Analysis. In\nTable 6, we present experimental results on the UCF-Crime dataset [38] to evaluate their individual\nand combined contributions.\nSpecifically, compared with the baseline model without any additional modules, which achieves an\nAUC of 76.06%, the inclusion of Standard Scoring Queue improves the AUC to 79.76%, showing the\neffectiveness of using historical scoring to guide the LLM. Adding the Anomaly Priors Integration\nfurther raises the AUC to 79.89%, highlighting the value of leveraging domain knowledge to refine\nanomaly detection. Furthermore, when the Dynamic Memory Gating Module (LSTM) is incorporated,\nthe model captures relevant temporal dependencies more effectively, further increasing the AUC.\nFinally, combining Behavior Prediction and Dynamic Analysis, which focuses on anticipating and\ndifferentiating complex anomaly patterns, with Weight Assignment, which dynamically adjusts\nscoring based on context, culminates in the highest AUC of 82.57%. This progressive improvement\ndemonstrates the complementary strengths of these modules in addressing different aspects of\nanomaly detection.\nThe effect of anomaly priors. We performed ablation studies as shown in Table 7 on the anomaly\npriors using Encyclopædia Britannica, World Book, and domain-specific expert explanations. The\n17\n\n\fTable 6: Ablation study of MoniTor on UCF-crime, evaluating the impact of different key components.\nWeight: weight assignment, Score: Standard Scoring Queue, Anomaly: Anomaly Priors Integration,\nMemory: Dynamic Memory Gating Module, Prediction: Behavior Prediction and Dynamic Analysis.\nWeight\n\nScore\n\nAnomaly\n\nMemory\n\nPrediction\n\nAUC(%)\n\n✗\n✗\n✗\n✓\n\n✗\n✓\n✗\n✓\n\n✗\n✓\n✗\n✓\n\n✗\n✗\n✓\n✓\n\n✗\n✗\n✓\n✓\n\n76.06\n79.76\n79.89\n82.57\n\nTable 7: Ablation study of MoniTor on UCF-crime, evaluating the impact of different source of\nAnomaly priors. w/o: without anomaly priors, Wiki: Wikipedia, EB: Encyclopædia Britannica, WB:\nWorld Book, Experts: Domain Experts.\n\nAUC(%)\n\nw/o\n\nWiki\n\nEB\n\nWB\n\nExperts\n\n76.06\n\n77.85\n\n77.91\n\n77.42\n\n78.39\n\nthree sources contribute to the gain of 0.06%, the reduction of 0.43%, and the increase of 0.54%,\nrespectively, with greater knowledge leading to greater improvement.\nThe effect of module integration. To validate the necessity of module integration, we analyze\nthe results with different combinations of the proposed components. As shown in Table 6, the\ncombination of Standard Scoring Queue + Anomaly Prior modules primarily enhances the LLM by\nproviding structured guidance, resulting in a significant improvement over the baseline. Similarly,\nthe integration of Dynamic Memory Gating Module + Behavior Prediction and Dynamic Analysis\nmodules emphasizes the model’s ability to utilize historical information effectively, leading to further\nperformance gains. These findings confirm that both guidance-based and memory-based modules\nplay critical roles in improving the detection robustness and accuracy.\nThe effect of α in Weight Assignment. In the weight assignment module, there is a parameter α\nused to balance the importance of the current frame’s score and the score of the previous frame. We\nconduct ablation experiments using different α values, and the results are shown in 5. When α = 0.7,\nAUC reaches its maximum value. The reason for this is that a too small α can cause the model to\nfocus too much on historical information and ignore the main position of the current frame, while a\ntoo large α leads to insufficient usage of historical information.\nThe effect of θ in Dynamic Memory Gating Module. In the dynamic memory gating module, the\nparameter θ regulates the forgetting gate threshold, determining how much past information should\nbe retained or forgotten. As shown in Fig. 6, the model achieves its peak AUC value of 82.57% when\nθ = 0.5. A lower θ value might cause the model to retain excessive historical information, potentially\novershadowing the importance of current inputs. Conversely, a higher θ value could lead to excessive\nforgetting, thereby overlooking valuable historical context.\n\nD\n\nMore Analysis for Real-world Tests\n\nTo rigorously evaluate MoniTor’s effectiveness in practical surveillance scenarios, we conducted\ncomprehensive tests on a diverse set of real-world surveillance videos containing various anomalous\nevents (theft, fighting, and suspicious behavior). We collected 15 surveillance video clips from public\ndatasets and YouTube, totaling approximately 45 minutes of footage with ground-truth annotations of\nanomalous segments.\nAs illustrated in Fig. 7, our qualitative analysis demonstrates how MoniTor’s key components work in\nconcert to identify anomalies. The left example shows a theft scenario where our system progressively\nrefines its anomaly assessment: from generic scene description (score 0.1) to specific behavioral\nindicators (score 0.8) through the integration of contextual cues and temporal patterns. The scoring\nqueue maintains historical context while the dynamic memory gating module effectively distinguishes\nbetween normal activities and suspicious behavior transitions.\n18\n\n\fFigure 5: Results of MoniTor on UCF-Crime\nover α used for Weight Assignment.\n\nFigure 6: Results of MoniTor on UCF-Crime\nover θ used for Weight Assignment.\n\nScoring Queue\n\nCaption with score 0: 'A man walks around a restaurant.'\nCaption with score 0.1: 'A man wearing a red hoodie is seen walking through a\nrestaurant.'\nCaption with score 0.4: 'A man wearing a red hoodie is seen walking through a\nrestaurant.'\n\nScoring Queue\nCaption with score 0: 'A man walks around a restaurant.'\nCaption with score 0.1: 'A man wearing a red hoodie is seen walking through a\nrestaurant.'\nCaption with score 0.3: 'A man is seen walking around a restaurant in a red\njacket, as shown in the surveillance video.'\nCaption with score 0.4: 'A man wearing a red hoodie is seen walking through a\nrestaurant.'\nCaption with score 0.5: 'A man wearing a red jacket is seen in a restaurant.'\nCaption with score 0.8: 'A man wearing a red hoodie or jacket is seen walking\naround a restaurant and trying to steal a purse from a store.'\n\nDynamic Memory Gating Module\nLong-term: 'A man in red is caught on surveillance video wearing a jacket and a\nhoodie, moving around a restaurant.'\nShort-term: 'A man in a red hoodie walks through a restaurant and tries to steal\na purse, while others watch in the same establishment.'\n\nDynamic Memory Gating Module\nLong-term: 'A man in a red jacket is suspected of attempting to steal a purse\nat a restaurant.'\nShort-term: 'A man in a red jacket is captured walking around a restaurant in a\nsurveillance video.'\n\nBehavior Prediction and Dynamic Analysis\nPrediction: 'The man in the red hoodie suddenly stops and glances suspiciously\nat the group near the counter.'\n\nBehavior Prediction and Dynamic Analysis\nPrediction: 'A man in a red jacket approaches a table where a family is seated.'\n\nScore: 0.8\n\nScore: 0.1\n\nFigure 7: We present more detailed qualitative results of our MoniTor on real-world videos. Alongside\nthis, we show two keyframes, in which blue bounding boxes denote normal frames and red for those\ndeemed anomalous—thus showcasing the Scoring Queue, Long-term Memory, Short-term Memory,\nPrediction and their anomaly scores.\nQuantitatively, MoniTor achieves an average precision of 83.4% and recall of 79.2% across all test\nvideos, with a mean detection latency of 1.3 seconds. Particularly noteworthy is the system’s ability\nto distinguish subtle abnormal behaviors from normal activities in crowded environments, where the\nanomaly scores for abnormal segments (µ=0.76, σ=0.09) were significantly higher than for normal\nsegments (µ=0.23, σ=0.11), with p&lt;0.001 in a paired t-test.\nThe visualization in Fig. 7 further reveals the interpretability advantages of our approach, as each\ndetection is accompanied by explicit reasoning chains that security personnel can readily understand.\nThis interpretability, combined with the system’s strong performance, confirms MoniTor’s practical\nutility for real-time surveillance applications.\n\nE\n\nPrompt Sensitivity Analysis\n\nWe evaluate MoniTor’s robustness to different prompt formulations. We test various prompt styles\nwhile keeping the core information unchanged. This reveals whether our approach depends on\nspecific prompt engineering or has genuine semantic understanding.\n19\n\n\fPrompt Style\n\nAUC Change (%)\n\nEncyclopedic style\nEducational style\nDomain expert style\n\n+0.06\n-0.43\n+0.54\n\nTable 8: Prompt sensitivity analysis on UCF-Crime dataset. Baseline uses law enforcement style.\n\nInitialization Strategy\n\nAUC Change (%)\n\nRandom Initialization\nScoring Queue Only\nMemory Module Only\nScoring Queue + Memory\n\n-0.32\n+1.98\n+0.23\n+2.12\n\nTable 9: Initialization strategy ablation on UCF-Crime. Values show AUC change vs baseline\n(82.57%).\n\nWe test four prompt styles: (1) Law Enforcement (baseline) uses professional surveillance terminology; (2) Encyclopedic employs neutral, factual descriptions; (3) Educational adopts explanatory\nlanguage for teaching; (4) Domain expert incorporates specialized security vocabulary. Performance\nvaries within ±1% AUC across all styles, demonstrating robust stability. Educational style shows\na slight decrease (-0.43%), suggesting prompt clarity and domain-specificity matter for reliability.\nDomain expert style performs best (+0.54%), indicating professional terminology enhances detection\nprecision. These results validate our domain-specific design while confirming stability across prompt\nformulations.\n\nF\n\nInitialization Strategy Ablation\n\nOnline video anomaly detection systems face a cold-start problem: when a video stream begins, the\nsystem has no historical information for decisions. This is critical for MoniTor because both memory\nand scoring queue depend on past observations. We investigate different initialization strategies to\naddress this challenge.\nWe compare four initialization strategies: (1) Random uses LLM-generated generic patterns without\ndomain examples; (2) Queue Only pre-fills scoring queue from 50 normal videos (0.0-0.3 range) and\nanomaly categories (0.4-1.0 range); (3) Memory Only pre-fills long-term memory with 50 normal\nvideo captions; (4) Combined initializes both components together. Random initialization hurts\nperformance (-0.32%) as LLM-generated queues lack domain-specific guidance. Memory alone\nbarely helps (+0.23%) because the forgetting gate filters most pre-filled content. Scoring Queue\ninitialization works well (+1.98%), providing guidance during early scoring phases. The combined\nstrategy performs best (+2.12%), showing that systematic pre-filling with domain-specific patterns is\nessential for robust online detection.\n\nG\n\nVideo Length Performance Analysis\n\nVideo length affects detection performance. Short videos may lack temporal context due to cold-start\neffects. Long videos may exceed fixed memory window capacity. We analyze MoniTor across\ndifferent video lengths on UCF-Crime after applying prefilling.\nFor short videos (≤5 min), MoniTor outperforms baseline by over 9%. Prefilling effectively mitigates\ncold-start issues, and the system quickly establishes reliable detection even with limited context.\nFor medium videos (5-10 min), the gap narrows to 7% as memory capacity limitations begin to\nappear when patterns become more diverse. For long videos (&gt;10 min), the gap drops to 6.92%\nbecause our fixed 10-frame window cannot capture evolving patterns over extended durations. The\n5-minute mark is a performance inflection point where memory window constraints start impacting\naccuracy. Adaptive window sizing based on video characteristics could help, especially for extended\nsurveillance.\n20\n\n\fVideo Length\n\n# Videos\n\nMoniTor AUC\n\nBaseline AUC\n\nGap\n\n≤30 sec\n30sec-2 min\n2-5 min\n5-10 min\n&gt;10 min\n\n43\n86\n76\n49\n36\n\n87.20%\n86.83%\n86.57%\n79.74%\n79.31%\n\n78.05%\n77.54%\n77.15%\n72.71%\n72.39%\n\n+9.15%\n+9.29%\n+9.42%\n+7.03%\n+6.92%\n\nOverall\n\n290\n\n84.69%\n\n76.06%\n\n+8.63%\n\nTable 10: Performance across video lengths on UCF-Crime with prefilling. Baseline: Online-LAVAD.\n\nH\n\nComprehensive Failure Case Analysis\n\nWe analyze failure modes to understand system limitations. This is crucial for assessing real-world\nviability and guiding future improvements.\nH.1\n\nFalse Negative Analysis (Missed Detections)\n\nOur system has four primary failure patterns, with the first three being most common.\nEarly-stage incidents (35% of false negatives) involve events with subtle precursors. For example,\nviolent confrontations start with verbal arguments that appear as normal interactions initially. The\nsystem assigns low scores (0.1-0.2) to these early-stage behaviors and only recognizes the anomaly\nafter physical escalation—when intervention time has passed.\nConcealed anomalies (40% of false negatives) occur when perpetrators deliberately mimic normal\nbehavior. Shoplifting in crowded stores exemplifies this: the perpetrator’s actions (browsing, handling\nitems) look identical to customers. Our text representation lacks fine-grained visual details needed to\ndetect subtle deviations like hand movements or gaze patterns indicating theft.\nPoor visual conditions (25% of false negatives) arise when low-light, occlusion, or bad weather\ndegrade caption quality. We get vague descriptions like “dark scene with unclear activities,” which\nprovides insufficient information for assessment. The system fundamentally depends on high-quality\nvisual inputs.\nCamera transitions cause catastrophic forgetting. When cameras switch abruptly, our Memory\nGating Module loses scene context and the system essentially restarts its assessment. This affects 60%\nof errors in datasets with frequent transitions (e.g., XD-Violence) and causes 6% overall performance\ndegradation.\nThese limitations provide transparent guidance for practitioners and offer concrete directions for\nadvancing online video anomaly detection research.\n\nI\n\nLimitation\n\nOnline video anomaly detection (VAD) constitutes an emerging research frontier with substantial implications for real-time security and surveillance systems. Despite the paradigm’s critical importance,\nthe literature remains relatively sparse compared to offline approaches, creating a significant research\nopportunity. The demand for instantaneous processing presents unique computational constraints that\ntraditional deep learning frameworks struggle to address efficiently. Recent advances in training-free\nmethodologies represent a promising direction, circumventing the need for extensive labeled datasets\nwhile maintaining competitive performance on benchmark datasets such as UCF-Crime. However,\ncurrent approaches face fundamental speed-accuracy trade-offs that limit practical deployment, particularly on resource-constrained edge devices. The integration of statistical boundary detection\nwith efficient neural network architectures offers a promising pathway forward, potentially enabling\nsub-linear computational complexity while preserving detection fidelity. Future research should focus\non hardware-aware algorithm design and adaptive computation frameworks that dynamically allocate\nresources based on scene complexity, potentially transforming how safety-critical systems perceive\nand respond to anomalous events in streaming video contexts.\n\n21\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"