"<!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>Hy-Memory-30B-A3B: Attributed Reinforcement Learning for\nLong-Term Memory Writing\nTianxiang Fei\nJiazheng Kang\nMao Zheng\nXingyan He\nXiang Yu\nTencent Hunyuan\n\narXiv:2610.22196v1 [cs.CL] 15 Oct 2026\n\nAbstract\nExternal-memory systems extend language-model applications beyond a context window, but their\nquality depends critically on the model executing the write path: deciding what to retain, how precisely\nto represent it, and how new evidence should update persistent state. Existing frameworks typically place\na general-purpose large language model behind framework-specific prompts. This raises serving cost,\nand a writer specialized for one protocol does not transfer directly to another; a unified model that can\noperate across established memory frameworks remains largely unexplored. We present Hy-Memory30B-A3B, a compact long-term-memory writer trained across Mem0, MemOS, and Hy-Memory. Memory\nOn-Policy Distillation teaches framework-specific write protocols on student-generated states; Memory\nRL then optimizes downstream answerability using dense per-chunk probes, attributed cross-chunk\nrewards, over-storage controls, and chunk-level GRPO. Carrying policy-written banks across windows\nkeeps training aligned with deployment. On fixed 20% benchmark subsamples, Hy-Memory-30B-A3B\nranks first on all four evaluated harnesses, including held-out EverMemOS, with a 55.49% macro average\nversus 54.62% for Claude Opus 5.\nhuggingface.co/tencent/Hy-Memory-30B-A3B\ngithub.com/Tencent-Hunyuan/Hy-Memory\n\n1\n\nIntroduction\n\nA long-term memory system for an LLM application usually contains three functional stages: (1) a writer\nconverts an interaction into persistent memory operations; (2) a retriever selects records relevant to a\nfuture query; and (3) a reader or answer model uses the retrieved records to respond.\nSystems such as Mem0, A-MEM, MemoryOS, and MemOS have expanded the design space of persistent memory through extraction, consolidation, hierarchical paging, linking, versioning, and lifecycle\nmanagement (Chhikara et al., 2025; Xu et al., 2025; Kang et al., 2025; Li et al., 2025). Benchmarks such as\nLoCoMo and LongMemEval have also shown that long-term memory is not a single retrieval problem:\nit includes precise extraction, multi-session composition, temporal reasoning, knowledge updates, and\nabstention (Maharana et al., 2024; Wu et al., 2025).\nDespite this progress, the write policy is commonly implemented by placing a general-purpose LLM\nbehind a long, framework-specific prompt. That model must simultaneously distinguish durable user\ninformation from greetings, assistant suggestions, and transient text; preserve exact names, numbers,\nversions, dates, paths, and other identifying details; represent a state transition without losing either the\nnew state or what it replaced; reconcile new evidence with retrieved memories already in the bank; and\nemit valid operations under the framework’s schema and control flow.\nThe framework cannot recover information that the writer omitted, and a powerful downstream reader\ncannot reliably infer a fact that was never stored. Conversely, indiscriminately storing everything\nincreases cost and retrieval interference. The desired writer is therefore not a generic summarizer: it is a\npolicy for changing an external state under a long-horizon downstream objective.\nRecent work has begun to train memory operations with reinforcement learning. Memory-R1 trains a\nmemory manager and an answer agent with final-answer rewards (Yan et al., 2025). MemAgent learns\nrecurrent textual compression from a terminal verifier (Yu et al., 2026). Mem-α combines downstream\nQA correctness with format, compression, and operation-quality rewards (Wang et al., 2025). MemCoE\n1\n\n\fexplicitly identifies sparse outcome reward as a weakness and adds guideline-aligned process feedback\n(Xu et al., 2026). These studies establish that memory behavior is learnable rather than fixed. They also\nexpose a remaining problem: a final answer score usually supervises an entire sequence of heterogeneous\nmemory actions, even though only a few actions supplied the evidence—or caused the failure.\nHy-Memory-30B-A3B focuses on this credit-assignment problem while preserving compatibility with\nexisting memory frameworks. Our contributions are:\n• A framework-integrated memory writer. Hy3-30B-A3B replaces the LLM inside Mem0, MemOS,\nand Hy-Memory without moving their memory logic into a custom model architecture.\n• State-distribution-aligned training. OPD and RL both execute the policy inside the actual\nharness, and later writes observe banks produced by earlier policy outputs.\n• Failure-surface reward data. Training questions are constructed from concrete write failures,\nincluding omission, lost specificity, semantic inversion, stale-state confusion, secondary-fact loss,\nand over-storage.\n• Attributed, non-binary feedback. Local probes provide dense per-chunk evidence, while crosschunk outcome questions use gold facts to map recovered evidence back to source chunks.\n• Chunk-level policy optimization. Advantages are normalized among rollouts at the same chunk\nposition rather than over whole trajectories, so one rollout can be credited at one chunk and\npenalized at another. Each rollout casts one vote per chunk even when a framework makes\nmultiple LLM calls.\n• Cross-harness and OOD results. Hy-Memory-30B-A3B ranks first on Mem0, Hy-Memory,\nMemOS, and held-out EverMemOS, averaging 55.49% across the four harnesses versus 54.62%\nfor Claude Opus 5.\n\n2\n\nBackground and Related Work\n\n2.1\n\nExternal memory systems and evaluation\n\nMem0 uses incremental extraction and consolidation to maintain a persistent memory store (Chhikara\net al., 2025). A-MEM organizes memories as dynamically linked notes whose attributes and relationships\nevolve as new information arrives (Xu et al., 2025). MemoryOS introduces an operating-system-inspired\nhierarchical storage architecture that coordinates short-term, mid-term, and long-term personal memory\nthrough dialogue-chain FIFO and segmented page updates (Kang et al., 2025). MemOS treats memory\nas a managed system resource and emphasizes representation, scheduling, provenance, and lifecycle\ncontrol (Li et al., 2025). These systems differ in schema and control flow, but all depend on an LLM to\ninterpret new interactions and produce valid operations.\nDCPM argues that long-term memory should support more than surface recall: its dual-process architecture represents belief revisions, identity, schemas, latent intentions, and cross-domain abstractions in a\ncapability hierarchy (Fei et al., 2026b). This direction is complementary to ours. DCPM redesigns the\nmemory architecture and its evolution process, whereas Hy-Memory-30B-A3B trains a reusable writer\nthat operates inside several existing memory architectures without replacing them.\nLoCoMo evaluates conversations containing hundreds of turns and multiple sessions, with questions\nrequiring single-hop, multi-hop, temporal, open-domain, and adversarial reasoning (Maharana et al.,\n2024). LongMemEval decomposes conversational memory into information extraction, multi-session\nreasoning, temporal reasoning, knowledge update, and abstention (Wu et al., 2025). Together, these\nbenchmarks motivate evaluating the full memory pipeline rather than the fluency of an extracted\nsummary.\nOur work draws two conclusions from this literature. First, memory quality must be measured downstream, after retrieval. Second, a useful reward dataset must cover distinct failure modes rather than\ncollapsing all memory behavior into one generic QA score.\n2.2\n\nReinforcement learning for memory\n\nThere are two related but distinct lines of memory RL.\n2\n\n\fMethod\n\nLearned policy and environment\n\nReward and distinction\n\nMemory-R1\n\nManager and answer agent over a structured\nexternal bank\nRecurrent writer and answer policy over\nmodel-native fixed memory\nConstruction policy over a custom\nmulti-component bank\nGuideline and evolution policy for\npersonalization memory\n\nDownstream answer outcome; writer is\nconfounded with the learned reader\nTerminal score broadcast over the trajectory; not\na drop-in writer\nGlobal QA plus local checks; global correctness\nis shared across actions\nProcess plus final-answer reward; checks\nguideline adherence rather than evidence\ncontribution\nPer-chunk recall, attributed outcome, and\ngrowth penalty; localizes evidence to writes\n\nMemAgent\nMem-α\nMemCoE\nHy-Memory30B-A3B\n\nWriter only, operating in Mem0, MemOS, and\nHy-Memory\n\nTable 1: How Hy-Memory-30B-A3B differs from prior memory RL.\nRecurrent compression agents. MemAgent processes a long document in chunks, repeatedly overwrites\na bounded textual memory, and applies a final verifiable answer reward to all generated conversations\n(Yu et al., 2026). This trains a model-native long-context mechanism, but the memory representation and\ninference loop are part of the learned architecture.\nExternal-bank management. Memory-R1 learns ADD, UPDATE, DELETE, and NOOP operations,\nand also trains an answer agent that filters retrieved memories (Yan et al., 2025). Mem-α formulates\nmemory construction as a sequence of operations over a multi-component bank and combines global\nQA correctness with local format and semantic-validity rewards (Wang et al., 2025). MemCoE uses an\ninduced guideline to construct denser process feedback because final answer rewards alone are sparse\nover long memory-evolution trajectories (Xu et al., 2026).\nHy-Memory-30B-A3B belongs to the second line but differs in scope. It trains the writer only, keeps\nthe reader fixed during reward computation, and targets multiple pre-existing harnesses rather than\none newly designed memory architecture. If the writer and answer model are optimized together, a\nbetter answer can come from improved reading rather than improved memory. Table 1 summarizes the\ndistinction.\nState separation also appears outside memory-specific agents. CodeDelegator separates persistent\norchestration state from ephemeral execution sandboxes to prevent debugging traces and intermediate\nfailures from polluting long-horizon planning context (Fei et al., 2026a). Our setting has a related systems\nrequirement: candidate rollouts must write to isolated banks, while only the selected bank persists across\nwindows. Unlike CodeDelegator, however, our separation is used for on-policy credit assignment over\nmemory writes rather than role-specialized code execution.\n2.3\n\nWhy ordinary outcome-only RL is insufficient\n\nLLM RL commonly assigns a scalar reward to a whole completion. PPO stabilizes policy updates with a\nclipped surrogate (Schulman et al., 2017), while GRPO replaces a learned critic with a baseline estimated\nfrom grouped samples (Shao et al., 2024). This works well when the completion is a single solution and\nthe final verifier is informative. A memory trajectory violates both assumptions.\nA write in an early session may matter only when a much later question asks about it, so most writes\nreceive no direct evidence. Giving the final QA score to every write rewards irrelevant actions and\npenalizes correct writes that co-occur with one bad action. Binary exact match often makes every rollout\nin a small GRPO group receive the same score, producing zero advantage and no task gradient; this has\nalso been observed in memory-grounded QA (He et al., 2026). Jointly improving the answer agent can\nraise QA accuracy while the bank remains incomplete or noisy. An action changes the bank seen by later\nactions, so examples are not independent prompts. One write may invoke one LLM call while another\ninvokes several, so a row-level baseline can weight call count rather than decision quality. Recall-only\nrewards can favor excessive storage.\nThe distinction between outcome and process supervision is well established in reasoning (Lightman et al.,\n2023). Memory writing needs a related but domain-specific decomposition. We do not label a hidden\n3\n\n\fFamily\n\nConfiguration\n\nRole\n\nMem0\nMemOS\nHy-Memory\nHy-Memory\nHy-Memory\n\nGeneral\nGeneral\nChat\nWorking\nCoding\n\nIncremental extraction and additive writing\nMulti-stage extraction and reconciliation\nPersonal conversational memory\nTasks, decisions, and project state\nCode, commands, bugs, and technical decisions\n\nTable 2: Harness families and scenario configurations.\n\nreasoning chain. Instead, we supervise observable consequences of each bank mutation: whether the\nintroduced fact remains recoverable, whether irrelevant text was stored, and whether later cross-chunk\nanswers recover the evidence contributed by that chunk.\n\n3\n\nProblem Formulation\n\n3.1\n\nUnified harness scope\n\nOPD and RL use the same conceptual harness set (Table 2). The three Hy-Memory rows are scenario\nconfigurations of one harness family, not three unrelated frameworks. “All trained harnesses” means\nthese five configurations from three harness families.\n3.2\n\nData hierarchy\n\nAn interaction sequence contains chronological sessions. Each session contains turns (one request and\nits response). A chunk is one harness write input, usually about ten turns, and never crosses a session\nboundary. A window is up to five consecutive chunks processed in one RL step and may span session\nboundaries.\n3.3\n\nMemory writing as an MDP\n\nFor chunk t, let Mt be the persistent memory bank and xt the raw interaction chunk. The policy receives\na harness-generated prompt containing xt and selected information from Mt , then produces one or more\nstructured LLM outputs at . The harness executes those outputs and creates the next bank:\ns t = ( Mt , x t , h ) ,\nat ∼ πθ (· | st ),\n\nMt+1 = Th ( Mt , at ),\n\n(1)\n\nwhere h denotes the harness configuration. The state lives primarily in the external bank, not in a\ncontinuous model context. Every LLM call may start from a fresh prompt, but the decisions are sequential\nbecause the bank carries their consequences.\nThis creates two training requirements: rollouts from one candidate must write to an isolated bank copy,\nand later windows must start from a bank the policy itself produced, not an annotation-derived ideal\nbank.\n3.4\n\nThree-model separation\n\nThe policy (Hy3-30B-A3B) sees the harness write prompt and produces all memory-write outputs; it is\nthe only model trained in Stage 2. The answer model sees the question and the retrieved memory block,\nand reads what the bank exposes. The judge sees the question, answer, reference, and rubric, and assigns\nsemantic credit. The answer model never sees the reference or rubric. The judge never sees the retrieved\nmemory block. Freezing both makes the memory bank the only changing component in the reward path.\n4\n\n\fDeployed harnesses\n\nSTAGE 1\n\nMem0\n\nMemOS\n\nHy-Memory · Chat\n\nHy-Memory · Working\n\nMemory on-policy distillation\n\nSTAGE 2\n\nHy-Memory · Coding\n\nAttributed memory RL\nchunk t\n\nchunk xt\nparent bank\n\nunmodified, shared by both stages\n\n1\n\n2\n\n3\n\n4\n\n5\n\nExamine each bank\n\ni=1\nparent bank\n\ncandidates ×2\n\nretrieve memory block\n\ni=2\n\nanswer model (frozen)\n\nHarness write path\n\nStudent πθ\n\nMt − 1\n\nMt\n\nHy3-30B-A3B\n\nsamples every LLM call\n\ninit\n\nM (w)\n\ni=3\n\nrubric judge (frozen)\n\nstep 375\n\nsi[t] = PRM + 2 ORM − 0.3 Penalty\ni=8\n\nsampled\ntokens\n\ntop-50\nreverse KL\n\nFrozen teacher\n\nchunk score si[t]\n\nchunk-level group Gt\nadvantage per chunk, not per rollout\n\nlow\n\nHy3 flagship · forward only\n\nhigh\n\nAi, t = (si[t] − meanGt s[t]) / stdGt s[t]\n\nPRM\nchunk probes + traps\nORM\nattributed outcome\nPenalty bank-token growth\n\ncarry the best final bank\narg max ∑si[t] (outlined)\ni\n\npromote one → parent of chunk t+1\n\nt\n\nbest bank → parent of window w+1\n\nFigure 1: Hy-Memory-30B-A3B is trained inside the same deployed harness configurations in both stages.\nOPD supplies dense teacher supervision on student-written state chains; RL examines the resulting banks,\nassigns chunk-level credit, and carries the selected bank across windows. In the rollout grid, each cell is\nthe bank after chunk t of rollout i, shaded by its chunk score si [t]. Advantages are normalized within\neach column (dashed: one chunk-level group), so the best rollout can differ from chunk to chunk. The\noutlined cell is the final bank with the highest ∑t si [t], which becomes the parent of the next window.\n\n4\n\nTwo-Stage Training\n\n4.1\n\nWhy two stages\n\nDirect RL from a generic instruction model wastes samples on protocol failures: malformed JSON, wrong\noperation names, missing fields, and invalid multi-stage control flow. Conversely, pure distillation\nteaches the model to follow a strong teacher but cannot rank the many valid memory representations by\ndownstream usefulness. OPD learns how to act inside each harness, with dense token-level supervision\non the student’s own prompts and outputs. RL learns which valid actions produce useful banks.\n4.2\n\nStage 1: Memory on-policy distillation\n\nSequence construction. Chronologically ordered interaction sequences are segmented into chunks\nwhile preserving session boundaries. Chat emphasizes personal facts and preference changes; Working\nemphasizes tasks, decisions, deadlines, and organizational context; Coding emphasizes repositories,\nfiles, commands, implementation decisions, and changing technical state. Each chunk is paired with the\nharness state produced by preceding student writes, so OPD supervision follows the state distribution\nencountered during deployment.\nOn-policy rollout. Each OPD row advances one (sequence, harness configuration) snapshot chain\nby one chunk. The rollout restores the selected parent bank Mt−1 , invokes the unmodified harness\nwrite path, routes every harness LLM call to the student, applies the student’s operations to produce a\ncandidate Mt , and promotes one candidate as the parent of the next chunk.\nThe teacher does not generate a separate ideal trajectory. It scores tokens on the trajectory the student\ngenerated. Supervision is placed on student-visited prefixes, reducing the exposure mismatch of static\nteacher demonstrations (Gu et al., 2024). For memory writing, the benefit extends beyond token prefixes:\nthe future prompts also contain memory states created by the student.\nObjective. The frozen Hy3 flagship teacher runs a forward pass on the student’s token stream and\nreturns its top-k distribution. With k = 50, the response-token objective is a top-k approximation to\n5\n\n\freverse KL:\n\nLOPD =\n\n1\nℓi,j ,\n|T | (i,j∑\n)∈T\n\nℓi,j =\n\n∑\n\n\u0002\n\u0003\nπθ (v | xi,&lt; j ) log πθ (v | xi,&lt; j ) − log π T (v | xi,&lt; j ) .\n\n(2)\n\nv∈top-50\n\nMiniLLM similarly motivates reverse KL on student-sampled trajectories (Gu et al., 2024). All LLM calls\nmade by one harness write are retained as explicit segments. Position ids reset at call boundaries, so\nindependent calls do not become one artificial conversation.\nConfiguration. The student is the Hy3-30B-A3B instruction-tuned checkpoint (∼3B active parameters).\nThe teacher is the Hy3 flagship model, forward only, returning top-50 log-probabilities. There are 2\nrollouts per row, learning rate 1e−6 (constant), and entropy coefficient 0.005. Prompt and response limits\nare 4,096 and 126,976 tokens across segmented calls. The checkpoint that initializes RL is OPD step 375.\nThe unified configurations are Mem0, MemOS, and Hy-Memory Chat, Working, and Coding.\n4.3\n\nStage 2: Memory reinforcement learning\n\nRL starts from OPD step 375 and executes the same harness configurations. For each window, eight\nrollouts begin from independent copies of the same parent bank. They write all chunks, are examined\nwith reward questions, and receive per-chunk scores. The highest-scoring final bank is promoted to the\nnext window in the same sequence. This is on-policy at two levels: tokens are sampled from the current\nwriter, and future prompts are generated from banks produced by that writer.\n\n5\n\nReward Construction: From Failure Surfaces to Attributed Feedback\n\n5.1\n\nWhy benchmark questions are not enough\n\nUsing only final questions from a long-memory benchmark creates a low-density learning problem. A\nlong interaction sequence may contain hundreds of useful facts but only a few questions. An unasked\nwrite receives no evidence, and a failed answer does not identify whether the cause was omission, bad\nwording, stale-state confusion, retrieval failure, or reader failure. Binary exact match further collapses\nsemantically partial answers and can eliminate variance within a small GRPO group (He et al., 2026). We\nconstruct reward items from the failure surface of memory writing, not merely from a list of benchmark\nanswers.\n5.2\n\nChronological segmentation\n\nInteraction sequences retain session boundaries and chronological order. Each session is segmented\nindependently into chunks of roughly ten turns, so a chunk never crosses a session boundary. The\nresulting chunks are flattened into one chronological stream; up to five consecutive chunks form one\nRL window, which may span sessions. Windows from the same sequence are consumed in order, and\nthe selected policy-written bank from one window initializes the next. This preserves long-range state\ntransitions while keeping each optimization step bounded.\n5.3\n\nTwo annotation passes\n\nLocal write quality and long-range memory utility require different context, so the two reward types are\nannotated in separate passes (Table 3).\nWhy the PRM pass sees the two preceding chunks. A per-chunk probe must test information that\nchunk t itself introduced. Annotating chunk t in isolation fails in two ways. Coreference: mentions such as\n“that project” or “the same reviewer” cannot be resolved, so the annotator cannot write self-contained\nquestions about them. Novelty: the annotator cannot tell whether a statement is new in chunk t or repeats\nsomething already established, so probes would credit chunk t for facts it did not introduce. The extracted\nfacts of chunks t−1 and t−2 supply the referents and the recently established state. They are given as\nfacts rather than raw text and serve as context only: no probe is generated from them, and they earn no\ncredit for chunk t.\n6\n\n\fPass\n\nAnnotator context\n\nOutput and target\n\nFull text of chunk t plus facts of chunks t−1 and Atomic facts, probes, traps, and rubrics; tests\nt −2\nwhether chunk t was written precisely and\nremains recoverable\nCross-chunk\nEarlier-sequence facts plus all facts in the\nQuestions, evidence chunks, gold facts, and\nrubrics; tests relations spanning chunks or\noutcome (ORM) current window\nsessions\n\nPer-chunk\nprobe (PRM)\n\nTable 3: The two annotation passes and the reward each one feeds.\n\nAgentic trajectory\n\n1\n\nOne user\n\n3\n\nSplit within each session\n\nthree ordered sessions\none block = one turn\n\nSession 1\n\nChunking &amp; windows\n\n2\n\nSession 1 · 18 turns\n\nearlier t−2 t−1\n\nrecall probes\n\nt\n\nt+1 t+2\n\ntrap probes\n\nc2\n\nsees: full text of chunk t\n+ facts of chunks t−1, t−2\n\nc3\n\n17 turns\n\nc5\n\nc1\n\nc2\n\nc6\n\nc3\n\nw1\none chronological timeline\n\nChunk cells\nNo answer leakage\n\nc4\n\nData verification\n\nReward artifact\n\n5\n\nStructural filters\nschema validity\ncausal locality\nrubric independence\nprobes\n\n478k → 410k\n\nquestions\n\n72k → 61k\n\n12,671\nwindows\n\n57,616\nchunks\n\n164,576\n\nrecall probes\n\n8,599\n\ngenerated → kept\n\nORM · cross-chunk pass\nc7\n\nearlier\n\nchronological chunk stream\n\n24 turns\n\nweighted rubrics\n\nc4\n\nSession 3 · 24 turns\n\nSession 3\n\natomic facts\n\n18 turns\nc1\n\n4\n\nPRM · per-chunk pass\n\nabout 10 turns / chunk\n\nSession 2 · 17 turns\n\nSession 2\n\nTwo annotation passes\n\nc5\n\nc6\n\n1\n\n2\n\n3\n\n4\n\n5\n\nsees: facts of earlier windows\n+ facts of all chunks in window\n\nw2\n\n≤ 5 chunks / window · one RL step\n\nweighted rubrics\n\n5 synthetic answers per item\nexpected\nfull\nreference\nfull\nparaphrase\npartial\npartial answer\nzero\ndistractor\nzero\nrefusal\n\npilot separation 0.95 / 0.87\nprobes / outcomes\n\nfull chunk text shown to the annotator\ngold facts are seen only by the outcome judge\n\nquestions\nevidence chunks\ngold facts\n\nc7\n\nonly extracted facts shown; items may cite it\n\n·\n\nthe answer model sees only the retrieved memory\n\ntrap probes\n\nDiscriminability test\n\ncontext only; no probe or credit\n\n·\n\n≈ 60.8k\n\noutcome questions\n\n222,395\n\ngold-fact references\n\none harness config\nper interaction sequence\n\nnot shown\n\nearlier-window facts are context and earn no credit\n\nFigure 2: Construction of the Memory RL reward artifact. Each session is split independently into\nchunks of about ten turns, so chunks never cross session boundaries. The chronological chunk stream\nis then grouped into RL windows of at most five chunks; a window may span sessions. The per-chunk\nprobe pass writes the PRM items for chunk t. It reads the full text of chunk t plus the extracted facts of\nchunks t−1 and t−2, used only to resolve references and decide what is new. The cross-chunk outcome\npass writes ORM items from the facts of the whole window and earlier history. Structural filters and a\nsynthetic-answer discriminability test produce the final artifact. The bottom row lists the rules that keep\nanswer information out of the reward path (Section 5.6).\n\nWhy not the full history. Dependencies that span more than a few chunks are covered by the crosschunk outcome pass, so the PRM pass does not need the whole sequence. Full history also lowers\nannotation quality. In a controlled comparison on identical chunks, full-history annotation used 33\ntimes more input tokens, while the two-chunk context produced 25% more proper nouns and 59% more\nnumbers per extracted fact. With the full sequence in view, the annotator’s attention spreads away from\nthe current chunk and its facts become more generic, which is the over-generalization failure (Section 5.4)\nthat probes are meant to detect.\n\n5.4\n\nFailure-surface taxonomy\n\nTable 4 lists the local failure modes. Cross-chunk questions add transition, coexistence, temporal,\naggregation, multi-hop, and negative recall. This follows the capability decomposition exposed by\nLoCoMo and LongMemEval (Maharana et al., 2024; Wu et al., 2025), but the questions are generated\nduring reward construction rather than copied from those benchmarks.\n7\n\n\fProbe type\n\nWhat the reward tests\n\nSpecificity\nSemantic precision\nPlain recall\nSecondary dimension\nTransition\nShould-not-store\nContent, not meta\nCasual detail\n\nExact names, numbers, titles, versions, paths, and entities survive writing\nNegation, scope, and event meaning are not inverted\nA durable explicit fact remains answerable\nA dominant topic does not erase a smaller detail\nThe new state and the state it supersedes are both represented\nGreetings, vague praise, and generic assistant text are absent\nThe memory stores the fact, not a meta-summary of it\nInformal but durable personal information is retained\n\nTable 4: Per-chunk failure-surface probes.\n5.5\n\nTrap probes and the precision–recall trade-off\n\nRecall alone makes “store everything” attractive. We add trap probes about content that should not have\nentered long-term memory, such as an assistant’s generic encouragement. Their reference answer is that\nthe bank contains no such record. If the writer stores the irrelevant statement, retrieval exposes it and\nthe answer becomes incorrect. Traps and the bank-growth penalty are complementary. A size penalty\ndiscourages indiscriminate volume, while traps directly test semantic selectivity. A model cannot avoid\nthe trap merely by compressing irrelevant text into a shorter entry.\n5.6\n\nRubrics and gold-fact attribution\n\nEach probe and outcome question contains weighted credit points with semantic equivalents; explicit\nfull-, partial-, and zero-credit bands; named distractors, including stale or superseded values; evidence\nchunk ids; and, for outcome questions, the source facts introduced by each evidence chunk. The answer\njudge performs semantic matching; code only aggregates returned credit.\nGold facts are visible only to the outcome judge. They are not inserted into the bank, retrieval query, or\nanswer-model prompt. Facts from earlier windows may provide context but are marked history-only\nand cannot generate credit for a current chunk.\n5.7\n\nData verification\n\nReward data must be tested as an instrument, not accepted because it is well-formed JSON. Four layers are\nenforced. Schema validity removes records with missing fields, unnormalized weights, illegal evidence ids,\nor illegal grading bands. Causal locality requires per-chunk probes to refer to the current chunk and crosschunk questions to contain multi-chunk evidence when required. Rubric independence checks that credit\npoints do not entail one another and that distractors represent real failure modes. Discriminability checks\nthat the judge scores five synthetic answers per item in the expected order: reference and paraphrase\nreceive full credit, a partial answer receives partial credit, and a distractor or refusal receives zero credit.\nIn the pilot, faithful paraphrases retain an average score of 0.90.\nThe structural pass keeps approximately 410k of 478k generated probes and 61k of 72k generated crosschunk questions. To control judge cost, at most three positive probes and one trap are retained per chunk.\nThe final artifact contains 164,576 positive probes, 8,599 traps, approximately 60.8k outcome questions,\nand 222,395 chunk-level gold-fact references.\nFuture work includes a random human audit with error categories and inter-annotator agreement; a\ntrain/evaluation near-duplicate and sequence-level leakage audit; per-scenario and per-failure-type\ncalibration on strong and weak writers; and judge sensitivity to prompt, model, and repeated sampling.\n5.8\n\nHarness-level artifact statistics\n\nEach complete interaction sequence is assigned to one harness configuration (Table 5). The offline\nschedule preserves within-sequence window order and consumes every row exactly twice over two\nepochs.\n8\n\n\fConfiguration\n\nProcessed units\n\nReward items\n\nHy-Memory / Chat\nHy-Memory / Working\nHy-Memory / Coding\nMem0\nMemOS\n\n3,182 windows; 14,519 chunks\n1,971 windows; 8,902 chunks\n1,154 windows; 5,187 chunks\n3,182 windows; 14,516 chunks\n3,182 windows; 14,492 chunks\n\n41,990 recall; 2,769 traps; 15,281 ORM\n25,272 recall; 1,537 traps; 9,740 ORM\n14,348 recall; 178 traps; 5,337 ORM\n41,416 recall; 1,969 traps; 15,228 ORM\n41,550 recall; 2,146 traps; 15,241 ORM\n\nTotal\n\n12,671 windows; 57,616 chunks\n\n164,576 recall; 8,599 traps; ∼60.8k ORM\n\nTable 5: Harness-level statistics of the RL reward artifact.\n\n6\n\nReward and Credit Assignment\n\n6.1\n\nThree-hop examination\n\nAll chunks in a window are written before scoring. For each question, the harness retrieves a memory\nblock from the written bank, the frozen answer model answers using only that block, and the frozen\njudge compares the answer with the reference and weighted rubric. This scores deployable bank behavior.\nDirectly asking a judge whether retrieved text “contains the answer” would not test whether contradictory\nor stale memories cause an incorrect response.\n6.2\n\nPer-chunk recall reward\n\nFor chunk t, let Rt be positive probes and Pt traps. With score zi ∈ [0, 1],\nprm[t] =\n\n∑i∈ Rt zi + ∑ j∈ Pt z j\n.\n| Rt | + | Pt |\n\n(3)\n\n“PRM” here means per-chunk recall reward, not a reward model over hidden reasoning steps. A chunk\nwith no valid probes receives zero rather than one. Items lost to an answer or judge service failure leave\nthe denominator; policy failures remain scoreable and receive low reward.\n6.3\n\nAttributed outcome reward\n\nFor outcome question q, the judge returns cq [t] ∈ [0, 1], the degree to which the answer recovered gold\nevidence introduced by chunk t. If Qt is the set of questions citing chunk t,\norm[t] =\n\n1\nc q [ t ].\n| Q t | q∑\n∈Q\n\n(4)\n\nt\n\nAveraging prevents a chunk from receiving more weight merely because the annotator wrote more\nquestions about it.\n6.4\n\nBank-growth penalty\n\nLet gt be bank-token growth divided by input-chunk tokens. Each harness has a free-growth lower\nthreshold ℓh and a full-penalty threshold uh :\n\u0012\n\u0013\ngt − ℓ h\nxt = clip\n, 0, 1 ,\nuh − ℓh\npen[t] =\n\ne3xt − 1\n.\ne3 − 1\n\n(5)\n\nTokens are measured instead of entry count because a writer can grow a bank by lengthening existing\nrecords. Shrinking the bank is neither taxed nor directly rewarded. Figure 1 labels this term Penalty.\n9\n\n\f6.5\n\nCombined score\ns[t] = wprm ∑ γk−t prm[k]\nk≥t\n\n+ worm orm[t] − wpen pen[t],\n\n(6)\n\nwhere wprm = 1, worm = 2, wpen = 0.3, and γ = 0. Gold-fact ORM attribution handles delayed\ncross-chunk evidence, so γ = 0 avoids broadcasting noisy future recall scores backward.\n6.6\n\nHow this resolves sparse ORM\n\nProbes give every chunk a local signal, so a sequence is not limited to a few terminal questions. Weighted\nrubrics with partial credit and distractors replace binary answer reward. Traps and the bank-growth\npenalty penalize over-storage. Gold facts attribute outcome evidence to evidence chunks instead of\nbroadcasting one score. The answer model and judge are frozen, so reader improvements cannot hide\nwriter defects. Continuous signals increase within-group resolution. Carrying the selected policy-written\nbank into the next window preserves cross-session effects. This is closer in spirit to process supervision\nthan terminal-only RL (Lightman et al., 2023), but the supervised unit is an externally verifiable bank\nconsequence rather than a subjective reasoning step.\n6.7\n\nChunk-level GRPO\n\nGRPO estimates a baseline from several samples without a separate value model (Shao et al., 2024).\nStandard GRPO scores each sampled trajectory once, normalizes that score within the group, and applies\nthe resulting advantage to every token of the trajectory. A trajectory-level group is not appropriate here:\nall eight rollouts share the same bank only at chunk 0; after that, rollout i observes the bank created\nby its own earlier actions, and a single trajectory score would again broadcast one judgment over all\nof its writes. We instead compute advantages per chunk, grouping by window, harness configuration,\nsequence, and chunk position:\ns [t] − µt\nAi,t = i\n,\n(7)\nσt + ϵ\nwhere µt and σt are the mean and standard deviation of s j [t] over the chunk-level group Gt . The best\nrollout can therefore differ from chunk to chunk: rollout 1 may have the highest score at chunk 2 while\nrollout 3 is best at chunk 4, and each chunk’s writes are reinforced or suppressed according to their own\ncolumn (Figure 1).\nEach rollout contributes one vote to the baseline for a chunk. If a multi-stage harness made three LLM\ncalls for that chunk, all three segments receive the same advantage but do not count as three independent\nobservations. Otherwise the policy could alter the baseline by changing its call count. Groups with fewer\nthan two valid rollouts receive zero advantage.\n6.8\n\nBank carry-forward\n\nBank selection is a separate, rollout-level decision. At the end of a window, the eight final banks are\nranked by ∑t s[t]. The winner becomes the initial state of the next window in that sequence; the others\nare discarded. If all candidates fail because of platform faults, the previous bank is reused. Bank state is\ncheckpointed with model state.\nAn inherited error from an earlier optimizer step cannot receive retrospective gradient. Carrying imperfect\npolicy-written banks is still preferable to teacher forcing with an ideal bank: deployment also requires\nthe writer to operate on its own prior mistakes. An inherited error common to all candidates also tends\nto cancel in the group-relative baseline rather than being assigned to the current chunk.\n\n7\n\nTraining System\n\nEach harness is packaged behind a common interface: bank_open, write, search, bank_stats, and\nbank_close. The harness owns its native control flow. Harness-invoked LLM calls are routed to the policy\n10\n\n\fMemory writer\n\nMem0 Hy-Mem. MemOS EverMem. Avg.\n\nHy-Memory-30B-A3B\nClaude Opus 5\nDeepSeek V4.1 Flash\nHy3\nQwen3.6-35B-A3B\nHy3-A3B Base\nQwen3-30B-A3B\n\n54.02\n53.43\n49.73\n45.99\n47.51\n40.20\n39.81\n\n60.55\n60.53\n60.20\n58.06\n55.87\n50.39\n45.67\n\n50.51\n50.50\n49.17\n50.19\n47.36\n49.05\n45.44\n\n56.89\n54.04\n55.47\n52.30\n50.75\n50.98\n46.57\n\n55.49\n54.62\n53.64\n51.63\n50.37\n47.66\n44.37\n\nTable 6: Six-metric means on fixed 20% benchmark subsamples. The macro average weights the four\nharnesses equally.\nendpoint and recorded at generation time with token ids, rollout log-probabilities, segment boundaries,\nand MoE routing. This follows the harnessed-agent-RL pattern in which the deploy-time loop is kept\nintact while model calls connect to a trainer (Luo et al., 2025). Retokenizing text after execution can\ndiverge from the sampled stream, and recomputing rollout log-probabilities with the training engine\ndestroys the intended importance ratio.\nStage 2 starts from the OPD model, on Hy3-30B-A3B (∼3B active parameters), using 16 nodes × 8 H20\nGPUs (128 GPUs). A batch is 64 windows × 8 rollouts, or 512 trajectories. The objective is a PPO-style\nclipped surrogate with chunk-level GRPO advantages, aggregated as sequence mean then token mean,\nwith no KL penalty. MoE routing from the rollout is replayed during training. The learning rate is 5e−6,\nconstant. The context is 28,672 prompt tokens plus 4,096 response tokens. The resulting post-RL model\nis released and evaluated as Hy-Memory-30B-A3B. Model, optimizer, schedule, and selected banks are\ncheckpointed every 10 steps during training.\n\n8\n\nExperiments\n\n8.1\n\nEvaluation principles\n\nThe evaluation changes only the memory writer. For each comparison, the harness version and prompts\nare fixed, retrieval configuration is fixed, and the answer model, judge, and other framework-side\ncomponents are held fixed. Throughout this report, every reference to a DeepSeek Flash endpoint denotes\nDeepSeek V4.1 Flash. Decoding settings are matched where APIs permit, each writer builds its own bank\nfrom an empty state, and test examples and scoring rules are identical. This is necessary because memory\nquality is otherwise confounded with retrieval depth, reader capability, auxiliary-model capability, or a\npre-existing bank.\nSampled benchmark matrix. For computational efficiency, every benchmark in the main four-harness\nmatrix is evaluated on a fixed 20% subsample. The evaluated post-RL model is Hy-Memory-30B-A3B.\nScores are deterministic outputs of the fixed evaluation pipeline; no missing judgment is imputed as\nzero. Each harness score is the equal-weight average of six metrics: LoCoMo Judge, LongMemEval,\nPersonaMem-v2, Travel SPS, Shopping PS, and Code Memory Bench (CMB). CMB is itself the equalweight average of two repository QA evaluations. The overall score is the equal-weight average of the\nfour harness scores.\n8.2\n\nFinal cross-harness results\n\nHy-Memory-30B-A3B ranks first on all four harnesses. Relative to Opus 5, it gains 0.60 points on\nMem0, 0.02 on Hy-Memory, 0.01 on MemOS, and 2.86 on EverMemOS, for a macro-average gain of 0.87\npoints. Relative to DeepSeek V4.1 Flash, it gains 4.29 points on Mem0, 0.35 on Hy-Memory, 1.34 on\nMemOS, and 1.42 on EverMemOS, for a macro-average gain of 1.85 points. Relative to the Hy3-A3B base\ncheckpoint, the macro average improves by 7.84 points. The 0.01–0.02 point margins on MemOS and\nHy-Memory indicate parity with Opus 5 under this deterministic sampled evaluation, not a statistically\nresolved difference. The stronger evidence is the consistent ranking and the larger margin on the held-out\nframework.\n11\n\n\fHy-Memory-30B-A3B\n\nClaude Opus 5 (closed)\n\nDeepSeek V4.1 Flash (open)\n\nQwen3.6-35B-A3B (open, size-matched)\n\n60.55 60.53 60.20\n\n60\n\nMacro-average score (%)\n\n55.49\n\n54.62\n\n56.89\n\n55.87\n54.02\n\n53.64\n50.37\n\n50\n\n55.47\n54.04\n\n53.43\n50.51 50.50\n\n49.73\n\n50.75\n49.17\n\n47.51\n\n47.36\n\n40\n\n30\n0\n\nOverall\n\nHy-Memory\n\nMem0\n\nMemOS\n\nEverMemOS\nheld out\n\nFigure 3: Cross-harness macro-average scores on the fixed 20% benchmark matrix. Each harness score\naverages six metrics equally; Overall averages the four harnesses equally. EverMemOS is held out from\ntraining.\nThe six metrics stress different behaviors, so the average improvement does not require Hy-Memory30B-A3B to win every column. Its strongest recurring gains are on Travel SPS and CMB. On the held-out\nEverMemOS harness, the gain is driven particularly by Travel SPS (+10.65 points) and CMB (+13.66\npoints). Appendix A reports all six benchmark scores for every model and harness.\n8.3\n\nOOD framework generalization\n\nEverMemOS is not part of OPD or RL training. It is included only at evaluation time as a held-out\nframework and is the strongest open-source community memory baseline in this evaluation. HyMemory-30B-A3B reaches 56.89, compared with 55.47 for DeepSeek V4.1 Flash, 54.04 for Opus 5, and\n52.30 for Hy3. This result separates model-level memory-writing skill from memorization of the training\nharness protocols.\n8.4\n\nFuture ablations and audits\n\nThis report does not include controlled ablations of chunk-level versus window-level GRPO, gold-fact\nattribution versus broadcast ORM, positive probes versus probes plus traps, the bank-growth penalty,\nbinary versus rubric-based rewards, RL initialization from OPD versus generic SFT, or single-harness\nversus mixed-harness training. We leave these comparisons to future work. Additional reward-data\naudits should measure human–judge agreement, sensitivity to the judge model and prompt, score\ndistributions across synthetic answer types, separation between strong and weak memory writers, and\nthe fraction of zero-variance rollout groups before and after reward decomposition.\n\n9\n\nEngineering Lessons: Silent Failures\n\nSeveral failures looked healthy until an invariant was checked. A bank that did not persist across\nwindows still left files on disk and produced nonzero rewards; the check is to reopen a checkpointed\nbank and verify a known record before training. A teacher that returned no top-k values still returned\nsuccessful requests, but OPD gradients were zero; missing teacher fields must raise, and teacher-token\ncoverage must be monitored. When the per-chunk mapping was absent, a fallback broadcast one score\nto every segment; missing chunk-to-segment mappings must raise. A configuration omitted from a\n12\n\n\fhard-coded schedule still had valid artifacts on disk; schedule manifests must be audited against the\ndeclared harness set. String rules that graded semantics produced a plausible aggregate reward; semantic\nconditions belong in judge rubrics, not substring code. A “read all” that silently paginated made the bank\nentry count plateau at a default limit; pagination and token accounting must be tested explicitly. Failed\nwrites checkpointed as empty were marked complete; platform faults must be retryable and excluded\nfrom denominators. Sandboxes that shared a trajectory identity completed requests attached to the\nwrong rollout; every request must validate bank and trajectory identity. Malformed output treated as\nan environment error made bad actions disappear from training; policy mistakes should remain valid\nlow-reward trajectories.\nThe governing rule is: a bad policy action must receive low reward; a platform failure must not be\nmisrepresented as policy behavior.\n\n10\n\nLimitations and Future Work\n\nAttribution is evidence-based rather than counterfactual: recovered gold facts do not prove that a specific\nwrite caused an answer. Credit is truncated across optimizer steps, so earlier-bank errors cannot receive\nretrospective gradient. One-vote grouping fixes the baseline, but multi-call chunks can still carry more\nloss mass. Rubric rewards reduce sparsity but require human-agreement and judge-sensitivity checks.\nThe reward artifact covers Chat, Working, and Coding but not every long-term-memory workload;\nEverMemOS is only one held-out framework. The primary matrix uses deterministic 20% subsamples,\nso 0.01–0.02 point margins are not statistically significant; repeated training seeds remain future work.\nFinally, pooled scores can hide whether gains come from extraction, update, deletion, reconciliation, or\nretrieval-facing representation.\n\n11\n\nConclusion\n\nMemory writing is a long-horizon control problem over an external state, not merely a summarization\nprompt. Hy-Memory-30B-A3B first learns to operate real memory harnesses through on-policy distillation,\nthen optimizes the answerability and selectivity of the banks it creates through Memory RL. The central\ntechnical contribution is the reward interface: failure-driven probes make supervision dense, cross-chunk\nquestions measure downstream utility, gold facts attribute that utility to source chunks, traps and growth\npenalties close the store-everything shortcut, and chunk-level GRPO compares actions at the correct\ndecision boundary.\nHy-Memory-30B-A3B ranks first on Mem0, Hy-Memory, MemOS, and held-out EverMemOS. On fixed\n20% benchmark subsamples, it averages 55.49% across six metrics and four harnesses, ahead of Claude\nOpus 5 at 54.62%, DeepSeek V4.1 Flash at 53.64%, and the Hy3-A3B base checkpoint at 47.66%. The\nOOD EverMemOS result provides the clearest margin over Opus 5 (+2.86 points). Together, these results\nsupport memory writing as a transferable model capability rather than a collection of framework-specific\nprompt heuristics.\n\nResource Availability\nThe Hy-Memory framework code and evaluation utilities are available at https://github.com/\nTencent-Hunyuan/Hy-Memory. The Hy-Memory-30B-A3B model weights, configuration, and model card\nare available on Hugging Face at https://huggingface.co/tencent/Hy-Memory-30B-A3B.\n\nReferences\nPrateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. Mem0: Building\nproduction-ready AI agents with scalable long-term memory. arXiv preprint arXiv:2504.19413, 2025.\nTianxiang Fei, Cheng Chen, Yue Pan, Mao Zheng, and Mingyang Song. CodeDelegator: Mitigating\ncontext pollution via role separation in code-as-action agents. arXiv preprint arXiv:2601.14914, 2026a.\nTianxiang Fei, Mingyang Song, Mao Zheng, and Xiang Yu. Memory beyond recall: A dual-process\ncognitive memory system for self-evolving LLM agents. arXiv preprint arXiv:2606.09483, 2026b.\n13\n\n\fYuxian Gu, Li Dong, Furu Wei, and Minlie Huang. MiniLLM: On-policy distillation of large language\nmodels. In ICLR, 2024.\nXinjie He, Zhiyuan Lin, Su Liu, Jialun Wu, Qiyang Xie, Weikai Zhou, and Shuai Xiao. What training\ndata teaches RL memory agents: An empirical study of curriculum effects in memory-augmented QA.\narXiv preprint arXiv:2605.23067, 2026.\nJiazheng Kang, Mingming Ji, Zhe Zhao, and Ting Bai. Memory OS of AI agent. arXiv preprint\narXiv:2506.06326, 2025.\nZhiyu Li et al. MemOS: A memory OS for AI system. arXiv preprint arXiv:2507.03724, 2025.\nHunter Lightman et al. Let’s verify step by step. arXiv preprint arXiv:2305.20050, 2023.\nXufang Luo et al. Agent lightning: Train ANY AI agents with reinforcement learning. arXiv preprint\narXiv:2508.03680, 2025.\nAdyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang.\nEvaluating very long-term conversational memory of LLM agents. arXiv preprint arXiv:2402.17753,\n2024.\nJohn Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy\noptimization algorithms. arXiv preprint arXiv:1707.06347, 2017.\nZhihong Shao et al. DeepSeekMath: Pushing the limits of mathematical reasoning in open language\nmodels. arXiv preprint arXiv:2402.03300, 2024.\nYu Wang, Ryuichi Takanobu, Zhiqi Liang, Yuzhen Mao, Yuanzhe Hu, Julian McAuley, and Xiaojian Wu.\nMem-α: Learning memory construction via reinforcement learning. arXiv preprint arXiv:2509.25911,\n2025.\nDi Wu, Hongwei Wang, Wenhao Yu, Yuwei Zhang, Kai-Wei Chang, and Dong Yu. LongMemEval:\nBenchmarking chat assistants on long-term interactive memory. In ICLR, 2025.\nDerong Xu et al. Learning how and what to memorize: Cognition-inspired two-stage optimization for\nevolving memory. arXiv preprint arXiv:2605.00702, 2026.\nWujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. A-MEM: Agentic memory\nfor LLM agents. In NeurIPS, 2025.\nSikuan Yan et al. Memory-R1: Enhancing large language model agents to manage and utilize memories\nvia reinforcement learning. arXiv preprint arXiv:2508.19828, 2025.\nHongli Yu et al. MemAgent: Reshaping long-context LLM with multi-conv RL-based memory agent. In\nICLR, 2026.\n\nA\n\nDetailed Benchmark Results\n\nTables 7–10 report the six benchmark scores used to compute each harness mean in Table 6. All scores\nuse the same fixed 20% benchmark subsamples as the main evaluation. Hy-Memory-30B-A3B uses the\npost-RL model reported throughout this paper. Checkpoint identifiers are omitted.\n\n14\n\n\fWriter\nHy-Memory-30B-A3B\nClaude Opus 5\nDeepSeek V4.1 Flash\nHy3\nQwen3.6-35B-A3B\nHy3-A3B Base\nQwen3-30B-A3B\n\nLoCoMo LME PM-v2 Travel Shop. CMB Avg.\n59.54 73.00\n69.47 66.00\n58.78 69.39\n41.22 62.00\n50.00 69.00\n50.00 47.00\n46.18 56.00\n\n51.62\n53.58\n49.56\n44.44\n49.38\n40.82\n42.32\n\n54.51\n42.98\n35.07\n46.87\n36.39\n37.91\n31.98\n\n18.33\n17.78\n16.67\n17.22\n20.00\n14.44\n16.67\n\n67.13 54.02\n70.74 53.43\n68.92 49.73\n64.16 45.99\n60.30 47.51\n51.03 40.20\n45.68 39.81\n\nTable 7: Detailed results on the Mem0 harness.\nWriter\nHy-Memory-30B-A3B\nClaude Opus 5\nDeepSeek V4.1 Flash\nHy3\nQwen3.6-35B-A3B\nHy3-A3B Base\nQwen3-30B-A3B\n\nLoCoMo LME PM-v2 Travel Shop. CMB Avg.\n73.28 89.00\n74.43 89.69\n72.90 85.86\n69.47 89.00\n70.99 84.85\n66.41 87.00\n64.12 82.00\n\n51.54\n48.71\n49.00\n52.76\n43.56\n49.84\n41.06\n\n57.65\n51.34\n53.46\n49.01\n49.82\n31.36\n32.83\n\n21.11\n23.33\n22.78\n21.67\n20.00\n17.78\n18.89\n\n70.73 60.55\n75.70 60.53\n77.18 60.20\n66.44 58.06\n65.98 55.87\n49.97 50.39\n35.10 45.67\n\nTable 8: Detailed results on the Hy-Memory harness.\nWriter\nHy-Memory-30B-A3B\nClaude Opus 5\nDeepSeek V4.1 Flash\nHy3\nQwen3.6-35B-A3B\nHy3-A3B Base\nQwen3-30B-A3B\n\nLoCoMo LME PM-v2 Travel Shop. CMB Avg.\n62.98 73.00\n63.74 79.38\n61.07 73.00\n62.98 81.00\n55.34 79.00\n58.40 73.00\n59.16 73.00\n\n51.92\n52.84\n50.68\n49.64\n51.34\n50.86\n48.28\n\n24.15\n22.14\n18.61\n18.87\n20.08\n26.05\n23.03\n\n21.11\n19.44\n21.67\n18.89\n15.56\n21.11\n16.67\n\n69.91 50.51\n65.46 50.50\n69.97 49.17\n69.78 50.19\n62.82 47.36\n64.88 49.05\n52.49 45.44\n\nTable 9: Detailed results on the MemOS harness.\nWriter\nHy-Memory-30B-A3B\nClaude Opus 5\nDeepSeek V4.1 Flash\nHy3\nQwen3.6-35B-A3B\nHy3-A3B Base\nQwen3-30B-A3B\n\nLoCoMo LME PM-v2 Travel Shop. CMB Avg.\n73.28 76.00\n73.28 80.41\n72.52 82.83\n68.70 83.00\n69.08 79.00\n64.50 81.00\n67.94 60.00\n\n53.28\n51.19\n49.74\n48.68\n50.60\n52.14\n47.10\n\n56.56\n45.91\n59.47\n46.52\n43.53\n41.74\n44.80\n\n19.05\n23.89\n18.89\n19.44\n18.77\n20.56\n18.33\n\n63.19 56.89\n49.53 54.04\n49.38 55.47\n47.44 52.30\n43.52 50.75\n45.93 50.98\n41.27 46.57\n\nTable 10: Detailed results on the held-out EverMemOS harness.\n\nB\n\nHyperparameters\nStage 1: OPD\n\nStage 2: RL\nHy3-30B-A3B\nOPD step 375\n\nOrdering\n\nHy3-30B-A3B\nInstructiontuned\nMem0, MemOS,\nHy-Memory\nSnapshot chain\n\nUnit\n\nOne chunk write\n\nRollouts\nSignal\n\n2 per row\nTop-50 reverse\nKL\nToken-level\n\nModel\nInit.\nHarnesses\n\nAdvantage\nLR\nLength\nOutput\n\n1e−6\n4k / 127k\nOPD model initializes RL\n\nSame\nChronological\nwindows\nOne window, ≤5\nchunks\n8 per window\nPRM +2 ORM\n−0.3 Penalty\nChunk-level\nGRPO\n5e−6\n29k / 4k\nHy-Memory30B-A3B\n\nTable 11: Training hyperparameters for the two stages.\n\n15\n\n\f</code></pre></article>\n        \n</main>\n\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js\"></script>\n<script>\n\nfunction initTheme() {\n  const saved = localStorage.getItem('kb-theme') || 'light';\n  document.documentElement.setAttribute('data-theme', saved);\n  updateThemeIcon(saved);\n}\nfunction toggleTheme() {\n  const cur = document.documentElement.getAttribute('data-theme') || 'light';\n  const next = cur === 'light' ? 'dark' : 'light';\n  document.documentElement.setAttribute('data-theme', next);\n  localStorage.setItem('kb-theme', next);\n  updateThemeIcon(next);\n}\nfunction updateThemeIcon(t) {\n  const btn = document.getElementById('theme-toggle-btn');\n  if (btn) btn.innerHTML = t === 'dark' ? '☀️' : '🌙';\n}\ndocument.addEventListener('DOMContentLoaded', initTheme);\n\nfunction setViewMode(m) {\n  const grid = document.getElementById('bento-grid-view');\n  const list = document.getElementById('list-table-view');\n  const bGrid = document.getElementById('view-grid-btn');\n  const bList = document.getElementById('view-list-btn');\n  if (m === 'list') {\n    if (grid) grid.style.display = 'none';\n    if (list) list.style.display = 'flex';\n    if (bGrid) bGrid.classList.remove('active');\n    if (bList) bList.classList.add('active');\n  } else {\n    if (grid) grid.style.display = 'grid';\n    if (list) list.style.display = 'none';\n    if (bGrid) bGrid.classList.add('active');\n    if (bList) bList.classList.remove('active');\n  }\n  localStorage.setItem('kb-view', m);\n}\ndocument.addEventListener('DOMContentLoaded', () => {\n  const s = localStorage.getItem('kb-view') || 'grid';\n  setViewMode(s);\n});\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  document.querySelectorAll('pre').forEach(pre => {\n    const b = document.createElement('button');\n    b.className = 'copy-code-btn';\n    b.innerText = 'Copy';\n    b.onclick = () => {\n      const c = pre.querySelector('code') ? pre.querySelector('code').innerText : pre.innerText;\n      navigator.clipboard.writeText(c).then(() => {\n        b.innerText = 'Copied!';\n        setTimeout(() => { b.innerText = 'Copy'; }, 2000);\n      });\n    };\n    pre.appendChild(b);\n  });\n});\n\nwindow.addEventListener('keydown', (e) => {\n  if ((e.key === '/' || (e.metaKey && e.key === 'k')) && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n    const q = document.getElementById('global-search-input');\n    if (q) q.focus();\n  }\n});\n\n// Scrollspy for TOC\nwindow.addEventListener('scroll', () => {\n  const headers = document.querySelectorAll('.article-body h1, .article-body h2, .article-body h3');\n  const scrollPos = window.scrollY + 100;\n  headers.forEach(h => {\n    if (h.offsetTop <= scrollPos) {\n      const id = h.getAttribute('id');\n      if (id) {\n        document.querySelectorAll('.reading-sidebar a').forEach(a => {\n          a.classList.toggle('active', a.getAttribute('href') === '#' + id);\n        });\n      }\n    }\n  });\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  if (window.renderMathInElement) {\n    renderMathInElement(document.body, {\n      delimiters: [\n        {left: '$$', right: '$$', display: true},\n        {left: '$', right: '$', display: false},\n      ],\n      throwOnError : false\n    });\n  }\n});\n</script>\n\n</body>\n</html>\n"