"<!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>T RANSFORMERS ARE I NHERENTLY S UCCINCT\nRyan Cotterell\nETH Zürich\nZurich, Switzerland\nryan.cotterell@inf.ethz.ch\n\nPascal Bergsträßer\nRPTU Kaiserslautern-Landau\nKaiserslautern, Germany\nbergstraesser@cs.uni-kl.de\n\narXiv:2510.19315v3 [cs.FL] 15 May 2026\n\nAnthony W. Lin\nRPTU Kaiserslautern-Landau and MPI-SWS\nKaiserslautern, Germany\nlin@cs.uni-kl.de\n\nA BSTRACT\nWe study succinctness as a measure of the expressive power of transformers.\nSuccinctness—how compactly a formalism can describe a language relative to\nother formalisms—is a classical notion in logic and automata theory. We prove\nthat fixed-precision transformers are remarkably succinct: they can be exponentially more succinct than both linear temporal logic (LTL) and recurrent neural\nnetworks, and, by extension, state-space models, and doubly exponentially more\nsuccinct than finite automata. In other words, there exist families of languages\ndescribable by polynomial-size transformers whose smallest equivalent LTL formula or recurrent neural network is exponentially large, and whose smallest equivalent automaton is doubly exponentially large. We also establish matching upper\nbounds, showing that any fixed-precision transformer can be converted to an LTL\nformula with at most an exponential blow-up—improving a prior doubly exponential translation. As a consequence of this succinctness, we show that basic\nverification problems for transformers, such as emptiness and equivalence, are\nprovably intractable: specifically, EXPSPACE-complete.\n\n1\n\nI NTRODUCTION\n\nTransformers (Vaswani et al., 2017) are the dominant architecture underlying most modern large\nlanguage models. A substantial body of recent theoretical work has investigated their expressive\npower (Strobl et al., 2024; Barceló et al., 2024; Yang et al., 2024; Hahn, 2020; Pérez et al., 2021;\nChiang and Cholak, 2022; Jerad et al., 2025), their trainability and ability to generalize to unseen\nstrings of longer lengths (Zhou et al., 2024; Huang et al., 2025; Chiang and Cholak, 2022), and\nthe extent to which their behavior can be formally verified (Sälzer et al., 2025). A key finding of\nthis line of work is that transformers with finite precision—the setting most faithful to real-world\nhardware—recognize various classes of subregular languages depending on the exact assumptions\nmade (Yang et al., 2024; Barceló et al., 2024; Jerad et al., 2025; Li and Cotterell, 2025).\nSubregular languages constitute strict subclasses of the regular languages. For instance, the subregular class of star-free languages are precisely those definable by regular expressions that replace the\nKleene star with intersection and complementation. The language a∗ b∗ is star-free because it can be\nwritten as ∅ · b · a · ∅, whereas (aa)∗ is not star-free (Straubing, 1994). By contrast, recurrent neural\nnetworks (RNNs) can recognize all regular languages under a fixed precision assumption (Minsky,\n1967; Siegelmann and Sontag, 1995; Merrill et al., 2020; Svete and Cotterell, 2023), making them\nstrictly more expressive than transformers as language recognizers. However, the strong empirical\nperformance of transformers invites the question as to whether expressive capacity is the most\nrevealing lens through which to compare architectures.\nIn this paper, we propose succinctness as an alternative lens for understanding the expressivity of\ntransformers. The succinctness of a language L with respect to a class C of language recognizers\n(e.g., transformers, finite automata, and formulas in FO[&lt;]) measures the size of the smallest\n1\n\n\fC ∈ C that recognizes L. In other words, succinctness tells us how many symbols are needed to\ndescribe L with respect to the class C. Succinctness is a classical notion in logic and computer\nscience (Stockmeyer, 1974; Grohe and Schweikardt, 2004), where it sharpens expressive power\ninto a complexity-theoretic refinement: rather than asking only which languages a formalism can\nrecognize, succinctness asks how compactly each such language can be described within it. Greater\nsuccinctness comes at a price—more succinct formalisms typically have correspondingly harder\ndecision problems, since their compact descriptions force any decision procedure to unfold a larger\namount of underlying structure. A well-known example concerns linear temporal logic (LTL;\nPnueli, 1977), which is expressively equivalent to the star-free languages (Libkin, 2004), and, hence,\nalso to the counter-free automata of McNaughton and Papert (1971). Despite this equivalence in\nexpressive power, LTL can be exponentially more succinct than finite automata (Sistla and Clarke,\n1985), i.e., certain languages admit polynomial-size LTL formulas but require exponentially larger\nautomata. A direct consequence is that decision problems for LTL, such as checking whether a\nformula recognizes a trivial language, are provably harder than the corresponding problems for\nautomata (Sistla and Clarke, 1985).\nThis paper offers a formal result, which can be summarized as follows: transformers can describe\ncertain languages extremely succinctly. Specifically, we show that transformers can be exponentially\nmore succinct than LTL and RNNs, and hence also state-space models (SSMs; Gu and Dao, 2023;\nMerrill et al., 2024). Moreover, they are doubly exponentially more succinct than finite automata.\nIn concrete terms, there exist families of languages describable by polynomial-size transformers\nthat require exponentially larger LTL formulas or RNNs, and doubly exponentially larger automata.\nWe also establish matching upper bounds: we give a translation from finite-precision transformers\nto LTL formulas of exponential size, significantly improving the doubly exponential translation\nof Yang et al. (2024). It follows that for any fixed-precision transformer, there is an equivalent\nLTL formula of exponential size and an equivalent finite automaton of doubly exponential size.1\nThe key technical ingredient behind these results is showing that transformers can count from\nN\n0 to 22 —that is, implement doubly exponentially large counters—via a subtle encoding using\nattention. We then prove that the resulting languages require exponentially larger descriptions\nas LTL formulas or RNNs, and doubly exponentially larger descriptions as finite automata. A\nnatural consequence of this succinctness is that analyzing transformers should be computationally\nchallenging. And, indeed, we show that checking whether a given transformer recognizes a trivial\nlanguage, is EXPSPACE-complete. Under standard complexity-theoretic assumptions, this means\nthat no algorithm can solve the problem in less than double exponential time.\nThe specific transformer model we study is the unique-hard attention transformer (UHAT), a simple\nand widely used abstraction of self-attention (Yang et al., 2024; Jerad et al., 2025; Strobl et al., 2024;\nHao et al., 2022; Li and Cotterell, 2025; Hahn, 2020; Barceló et al., 2024; Bergsträßer et al., 2024).\nIn particular, Jerad et al. (2025) show that expressivity bounds on UHATs entail corresponding\nbounds on softmax transformers with fixed precision. Different results in this paper hold under\ndifferent precision assumptions: the UHAT upper bounds are stated for arbitrary rational weights,\nwhereas the corresponding RNN results assume fixed (finite) precision. Importantly, this means our\nconclusions are valid in the setting that most faithfully mirrors real-world implementations—fixed\nprecision arithmetic.\n\n2\n\nP RELIMINARIES\ndef\n\nWe adopt the following notational conventions in this paper. We write N = {1, 2, 3, ...} for the\ndef\nnatural numbers and N0 = {0, 1, 2, 3, ...} for the natural numbers including zero. Given N ∈\ndef\nN, we define [N ] = {1, ..., N }. Furthermore, we write Q for the rational numbers. We denote\nscalars by lowercase italicized Latin letters, vectors by boldface lowercase italicized Latin letters,\nand matrices by boldface uppercase italicized Latin letters. For a vector v = (v1 , ..., vD ), we write\ndef\nvi:j = (vi , ..., vj ) for all 1 ≤ i ≤ j ≤ D, and vi for its ith component. An alphabet is a finite, nonempty set Σ of symbols. A word (also called a string) is a finite sequence of symbols a = a1 ... aN .\n1\nThis holds without exception: the LTL bound is the constructive translation of Prop. 13, and the automaton\nbound is its composition with the standard exponential LTL-to-automaton conversion (Sistla and Clarke, 1985;\nVardi and Wolper, 1994); both are unconditional upper bounds on every fixed-precision transformer.\n\n2\n\n\fWe denote symbols using lowercase Latin letters and words as boldfaced lowercase Latin letters.\nWe write |a| = |a1 ... aN | = N for the length of a word a. We write Σ∗ for the set of all words—\ndef\nincluding the empty word ε—and Σ+ = Σ∗ \\ {ε}. A language is a subset L ⊆ Σ∗ .\nWe assume familiarity with basic formal language theory and complexity theory; see Kozen (1997)\nand Sipser (1997) for standard references. In particular, we work with finite automata and the\nfollowing complexity classes (Sipser, 1997):\nP ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP ⊆ EXPSPACE.\nP and NP are problems solvable by a Turing machine in polynomial and nondeterministic polynomial time, respectively, and EXP and NEXP are their exponential-time counterparts. PSPACE\nand EXPSPACE are problems solvable by a Turing machine in polynomial and exponential space,\nrespectively.\n2.1\n\nL INEAR T EMPORAL L OGIC\n\nA formula in linear temporal logic (LTL) over an alphabet Σ is defined by the grammar\nφ ::= ⊤ | ⊥ | Qa (a ∈ Σ) | φ ∧ φ | φ ∨ φ | ¬φ | φ S φ | φ U φ.\nSatisfaction of an LTL formula φ on a word a = a1 ... aN ∈ Σ+ at position n ∈ [N ], written\na, n |= φ, is defined inductively (omitting the trivial cases for ⊤ and ⊥):\na, n |= Qa\na, n |= φ1 ∧ φ2\na, n |= φ1 ∨ φ2\na, n |= ¬φ1\na, n |= φ1 S φ2\n\niff\niff\niff\niff\niff\n\na, n |= φ1 U φ2\n\niff\n\nan = a\n(a ∈ Σ)\na, n |= φ1 and a, n |= φ2\na, n |= φ1 or a, n |= φ2\na, n ̸|= φ1\nfor some j with 1 ≤ j &lt; n: a, j |= φ2 and\nfor all k with j &lt; k &lt; n: a, k |= φ1\nfor some j with n &lt; j ≤ N : a, j |= φ2 and\nfor all k with n &lt; k &lt; j: a, k |= φ1\n\nWe also use the standard abbreviations\nPφ := ⊤ S φ\n\nFφ := ⊤ U φ\n\nYφ := ⊥ S φ\n\nHφ := φ ∧ ¬P¬φ.\n\nAn LTL formula φ recognizes the language L(φ) consisting of all words a ∈ Σ+ where a, N |= φ.2\nExample 1. The star-free language (ab)+ can be defined in LTL as\n\u0001\n\u0001\nQb ∧ H Qb → YQa ∧ H (Qa ∧ Y⊤) → YQb .\n\n(1)\n\nEq. (1) asserts that the last letter is b, every b is preceded by a, and every a that has a predecessor\nis preceded by b.\n2.2\n\nU NIQUE - HARD ATTENTION TRANSFORMERS\n\nSymbol Embedding. Let Σ be an alphabet. A symbol embedding is a function emb : Σ → QD\nfor some D &gt; 0.3 A symbol embedding naturally extends to a homomorphism Σ∗ → (QD )∗ , where\nemb(a1 ... aN ) = emb(a1 ), ..., emb(aN ) for a1 , ..., aN ∈ Σ.\n2\n\nFor fragments that only allow U or F, we use a, 1 |= φ instead.\nWe define transformers over arbitrary rational numbers, as this is the most general setting in which our\nupper bounds hold. All results, however, carry over to fixed-precision arithmetic, i.e., a constant number of\nbits per value, independent of input length. The lower bounds hold under the even stronger restriction to fixedprecision integers. The precise statement of this carry-over depends on the formalization of fixed-precision\narithmetic adopted: standard floating-point representations (Goldberg, 1991) are not associative, so the value\nof, for example, a dot product in an attention head can depend on the order in which its summands are evaluated.\nOur claim should therefore be understood with respect to a fixed, deterministic evaluation order; algebraic\nidentities used in the proofs that rely on associativity (such as the order of summation) need to be re-checked\nunder any other choice.\n3\n\n3\n\n\fAttention layer.\n\nA unique hard-attention (UHA) layer of width R &gt; 0 is specified by:\n\n• Three affine transformations: A, B : QR → QR and C : (QR × QR ) → QS ;\ndef\n\n• A mask predicate M : N × N → {0, 1}, defined as one of M (n, m) = 1 (no masking),\ndef\ndef\nM (n, m) = 1[m &lt; n] (strict future masking), or M (n, m) = 1[m &gt; n] (strict past masking);\n• A tie-breaking function τ that selects an element of a finite, non-empty subset of N, defined\nas either min (leftmost) or max (rightmost).\nGiven a sequence of N vectors v1 , ..., vN ∈ QR with N ≥ 1, the layer operates as follows. The\nscore function is defined as the dot product\ndef\n\nS(vn , vm ) = ⟨A(vn ), B(vm )⟩\n\n(2)\n\nfor all n, m ∈ [N ]. For each position n ∈ [N ], let\ndef\n\n(3a)\n\ndef\n\n(3b)\n\nUn = {m ∈ [N ] | M (n, m) = 1}\nBn = {m ∈ Un | ∀m′ ∈ Un : S(vn , vm ) ≥ S(vn , vm′ )}\n\nbe the set of unmasked positions and the subset of those that maximize the score, respectively. The\ndef\ndef\nattention vector at position n is defined as an = vτ (Bn ) if Un ̸= ∅ and an = 0 otherwise. The\nlayer outputs the sequence C(v1 , a1 ), ..., C(vN , aN ).\nReLU layer. A ReLU layer of width R &gt; 0 applies, for a designated coordinate r ∈ [R], the\nReLU function to the rth component of each input vector. Formally, define ρr : QR → QR by\ndef\n\nρr (v) = (v1:r−1 , max(0, vr ), vr+1:R ).\n\n(4)\n\nGiven a sequence of N input vectors v1 , ..., vN ∈ QR with N ≥ 1, the layer outputs the sequence\nρr (v1 ), ..., ρr (vN ) obtained by applying ρr position-wise. Equivalently, one could place a feedforward network at the end of each encoder layer (Hao et al., 2022; Barceló et al., 2024).\nTransformer. A unique hard-attention transformer (UHAT) is a length-preserving function\nT : Σ+ → (QS )+ obtained by composing a symbol embedding with a finite sequence of UHA and\nReLU layers of conformable width. To use a UHAT T : Σ+ → (QS )+ as a language recognizer, we\nequip it with an acceptance vector t ∈ QS . The language recognized by T , denoted L(T ), consists\nof all words a ∈ Σ+ such that ⟨t, vN ⟩ &gt; 0 with T (a) = v1 , ..., vN ∈ QS .4\n2.3\n\nB OOLEAN RASP\n\nAs an intermediate step in proving EXPSPACE-hardness for UHATs, we use Boolean RASP\n(B-RASP; Yang et al., 2024), a programming language shown to be expressively equivalent to\nUHATs. A B-RASP program P is a finite sequence of predicates P1 , ..., PΠ ∈ {0, 1}[N ] . The\nprogram operates on an input word a = a1 ... aN ∈ Σ+ . The first |Σ| predicates are defined as follows. For each a ∈ Σ, there is a lookup function Qa ∈ {0, 1}[N ] defined by Qa (n) = 1 iff an = a.\nWe label these predicates P1 , ..., P|Σ| . Each remaining predicate Pt+1 , for t ≥ |Σ|, is built from\nP1 , ..., Pt by one of two operations.\n• A position-wise operation sets Pt+1 (i) := R(i), where R(i) is a Boolean combination of\nP1 (i), ..., Pt (i).\n• An attention operation sets\nPt+1 (i) := ◀▶j [M (i, j), S(i, j)] V (i, j) : D(i)\n\n(5)\n\nwhere ◀▶ ∈ {◀, ▶} and we define the following operations\n– ◀ and ▶ indicate leftmost and rightmost tie-breaking, respectively;\n– M (i, j) is a mask predicate as in the definition of a UHAT;\n– S(i, j) and V (i, j) are Boolean combinations of P1 (i), ..., Pt (i) and P1 (j), ..., Pt (j),\ncalled the score predicate and value predicate, respectively;\n4\n\nFor fragments that only allow strict past masking, we use ⟨t, v1 ⟩ instead.\n\n4\n\n\f– D(i) is a Boolean combination of P1 (i), ..., Pt (i).\nThe semantics of the attention operation are as follows. For each i ∈ [N ], let\n\u001a\nmin{j ∈ [N ] | M (i, j) = 1 and S(i, j) = 1}, for ◀\ndef\no(i) =\nmax{j ∈ [N ] | M (i, j) = 1 and S(i, j) = 1}, for ▶ .\ndef\n\n(6)\n\ndef\n\nThen Pt+1 (i) = V (i, o(i)) if o(i) exists, and Pt+1 (i) = D(i) otherwise.\nWe can view a B-RASP program as a language recognizer by asking whether PΠ (N ) = 1.5\n2.4\n\nR ECURRENT N EURAL N ETWORKS\n\nAs with transformers, we treat recurrent neural networks as language acceptors, following Merrill\net al. (2020) and Weiss et al. (2018; 2024). We define a recurrent neural network (RNN) as\na quadruple (Σ, g, h0 , f ) where Σ is an alphabet, g : (QD × Σ) → QD is a transition function,\nh0 ∈ QD is an initial hidden state, and f : QD → {⊥, ⊤} is an acceptance function. Consider\ndef\nstring a = a1 ... aN . For n ≥ 1, we define the nth hidden state hn = g(hn−1 , an ) inductively.\nWe say a is accepted iff f (hN ) = ⊤. As a computational model, it is natural to assume RNNs\noperate over a fixed precision, i.e., computation is always performed over rational numbers that\ncan be represented with a constant k number of bits. The details of the actual representation are not\nimportant for our analysis. Therefore, the state space of the above RNN can be mapped to D-vectors\nover {0, 1}k (instead of Q). The following proposition is now immediate.\nProposition 1. An RNN (Σ, g, h0 , f ) with g : (QD × Σ) → QD with fixed precision k can be\nrepresented by a finite automaton with 2kD many states.\n2.5\n\nS IZE MEASURES AND SUCCINCTNESS\n\nLet R be a finite representation of a language, i.e., in our case a UHAT, LTL formula, finite automaton, RNN, or B-RASP program. We define the size of R, denoted by |R|, as the length of its\nminimal binary encoding. In measuring succinctness of RNN, we put the precision k in unary also\nas part of the size measure; since we do not want to compare a transformer that uses a fixed precision\nk and allow an RNN that uses a fixed precision 2k .\nDefinition 2 (f -more succinct). Let C (1) and C (2) be classes of finite representations of languages,\nand let f : N → N be a function. We say C (1) is f -more succinct than C (2) if there is a family of\n(2)\n(1)\n(1)\nlanguages {Ln }∞\nof Ln such that every Rn ∈ C (2)\nn=1 together with representations Rn ∈ C\n(1)\n(2)\nrepresenting Ln satisfies |Rn | ≥ f (|Rn |).\nWe say C (1) is exponentially more succinct than C (2) if it is f -more succinct for some f (n) ∈\ncnd\n\nd\n\nΩ(2cn ) with c, d &gt; 0, and doubly exponentially more succinct if for some f (n) ∈ Ω(22\nc, d &gt; 0.\n\n) with\n\nDefinition 3 (g-bounded expansion). Let C (1) and C (2) be classes of finite representations of languages, and let g : N → N be a function. We say C (1) has g-bounded expansion over C (2) if for\nevery language L and every choice of representation R(2) ∈ C (2) of L, there is a representation\nR(1) ∈ C (1) of L with |R(1) | ≤ g(|R(2) |).\nWe say C (1) has polynomially bounded expansion over C (2) if it has g-bounded expansion for some\nd\npolynomial g, and exponentially bounded expansion if for some g(n) ∈ O(2cn ) with c, d &gt; 0.\nDef. 2 and Def. 3 are duals. On one hand, Def. 2 is an existential lower-bound: it asks for a\nwitness family on which C (2) is forced to be at least f times bigger than C (1) . On the other, Def. 3\nis a universal upper-bound: it asks that on every language, every C (2) representation has a C (1)\ntranslation of size at most g. Neither definition alone is antisymmetric, but together they pin the gap:\nC (1) is f -more succinct and has g-bounded expansion over C (2) exactly when the size gap is at least\nf on a witness family and at most g uniformly.\n5\n\nAs for UHATs, we use PΠ (1) = 1 if only strict past masking is allowed.\n\n5\n\n\f3\n\nT HE SIZE OF SMALLEST WITNESS VIA NON - EMPTINESS PROBLEM\n\nWe now consider the problem of checking whether the language recognized by a UHAT or B-RASP\nprogram is non-empty. In particular, the technique is essentially a simulation of a Turing machine\nwith an 2O(N ) -sized tape for a given N . As we will see later, there are Turing machines such that\nΩ(N )\nthe shortest accepted word by the constructed UHAT is of length at least 22\n.\ndef\n\nExample 2. We consider an example with N = 4. Let Σ = {0, 1, #, a, b, c}, and let H =\n{(a, b), (b, c), (b, a), (c, b)} be a set of constraints specifying which symbols can appear in adjacent\npositions. We now describe a B-RASP program that accepts words of the form\n0000a1 #0001a2 #0010a3 #... #1111a24 #\nsuch that (an , an+1 ) ∈ H for all 1 ≤ n &lt; 24 . We show how to construct a B-RASP programs that\n(i) check that the bit counter is incremented, and (ii) check that the successive symbols are in H.6\nTo check (i), we use the following attention operation:\nC+1 (i) := ▶j [j &lt; i, Q# (j)]\n\n4\n_\n\nk−1\n^\n\nk=1\n\nr=1\n\n\u0001\n¬Cr (i) ∧ Cr (j) ∧ Ck (i) ∧ ¬Ck (j)\n4\n^\n\n∧\n\n(7)\n\n!\nCr (i) ↔ Cr (j)\n\n\u0001\n\n:1\n\nr=k+1\n\nAssume i is a #-position. Attention selects the rightmost #-position j left of position i. Let bi1 ... bi4\nand bj1 ... bj4 be the bit words directly left of position i and j, respectively. We assume that we already\ndefined Ck (i) = bik and Ck (j) = bjk for all k ∈ [4]. Then, the above value predicate checks that\nthe bit word bi1 ... bi4 is the bit word bj1 ... bj4 incremented by 1. To check (ii), we can use the attention\noperation\n_\nM← (i) := ▶j [j &lt; i, Qa (j) ∨ Qb (j) ∨ Qc (j)]\nQh (j) ∧ Qh′ (i) : 1.\n(8)\n(h,h′ )∈H\n\nIf i is a position of a symbol ai , attention picks the rightmost position j of a symbol aj to the left of i\nand checks with the value predicate that (aj , ai ) ∈ H. Two boundary conditions remain: the input\nmust begin with the counter 0000 and end with the counter 1111. The first is a position-wise check\nat the leftmost #, requiring C1 (i) = ... = C4 (i) = 0 at that position; the second is the analogous\ncheck at the rightmost #, requiring all four bits to be 1. We omit the construction of these gadgets\nhere, since they follow the same pattern as C+1 and M← .\nThe construction given in Ex. 2 allows us to succinctly recognize a language whose shortest word\nhas length exponential in the number of bits of the binary counter. In the following, we describe how\nto extend this idea such that we can reduce an EXPSPACE-complete problem to non-emptiness of a\ncertain B-RASP program. Intuitively, we place multiple such words as above on top of each other,\ncreating multiple rows and columns (separated by #). Moreover, we introduce vertical constraints,\ni.e., between rows, in addition to the horizontal constraints H. Using this technique, we will see in\nThm. 15 how B-RASP programs can even succinctly recognize languages whose shortest word has\ndoubly exponential length.\nThroughout the rest of this section, we build up to the proof of the following complexity bound.\nTheorem 4. The non-emptiness problem for UHATs and B-RASP programs is EXPSPACEcomplete.\nTo prove Thm. 4, we start with the lower bound for B-RASP programs.\nProposition 5. The non-emptiness problem for B-RASP programs is EXPSPACE-hard.\nFor the proof, we use the construction sketched in Ex. 2 and reduce from the tiling problem.\nProblem 6. We now describe the 2N -tiling problem. A tile is a quadruple t = ⟨a, b, c, d⟩ ∈ N40 . We\nwrite left(t) = a, up(t) = b, right(t) = c, and down(t) = d.\n6\n\nFilling in the remainder of the B-RASP program to enforce the remaining constraints is straightforward.\n\n6\n\n\fGiven: An instance I = (N, T, tfin ), where N &gt; 0 is an integer in unary, T is a finite set of tiles,\nand tfin ∈ T is a designated final tile.\nQuestion: Do there exist a natural M ∈ N and a function τ : [2N ] × [M ] → T such that\n1. τ (2N , M ) = tfin ,\n2. down(τ (i, 1)) = up(τ (i, M )) = 0 for all 1 ≤ i ≤ 2N ,\n3. left(τ (1, j)) = right(τ (2N , j)) = 0 for all 1 ≤ j ≤ M ,\n4. right(τ (i, j)) = left(τ (i + 1, j)) for all 1 ≤ i &lt; 2N and 1 ≤ j ≤ M , and\n5. up(τ (i, j)) = down(τ (i, j + 1)) for all 1 ≤ i ≤ 2N and 1 ≤ j &lt; M ?\nA configuration of tiles, i.e., a candidate for the function τ , places tiles in 2N columns and an\narbitrary number (M ) of rows.\nProposition 7. The 2N -tiling problem is EXPSPACE-complete.\nProof. The result follows from Theorem 5 in Schwarzentruber (2019) by choosing k = 1.\n\n■\n\nTo prove Prop. 5, we construct a B-RASP program of size polynomial in N that accepts an encoding\nof a configuration of tiles as a sequence of words, similar to those displayed in Ex. 2, if and only if\nthe configuration is a solution of the given 2N -tiling problem instance. The key observation is that\nstrict future masking with rightmost tie-breaking enables us to check conditions between successive\ntiles in a row (Item 4) but also between the current tile and the tile at the most recent past occurrence\nof the same counter value, i.e., in the same column of the previous row (Item 5). The proof of the\nnext lemma can be found in App. A.2.\nLemma 8. Given a 2N -tiling problem instance, one can construct in time polynomial in N a BRASP program, whose language is non-empty iff the 2N -tiling problem instance has a solution.\nLem. 8 reduces the 2N -tiling problem to the non-emptiness problem for B-RASP programs. Thus,\ntogether with Prop. 7, it implies Prop. 5.\nWe observe that the B-RASP program constructed in Lem. 8 is of a special form, which allows for\na polynomial-time translation to UHAT.\nLemma 9. Given a B-RASP program P1 , ..., PΠ where every attention operation is of the form\n^\nPt+1 (i) := ◀▶j [M (i, j), S(j) ∧\nPk (i) ↔ Pk (j)] V (i, j) : D(i),\n(9)\nk∈K\n\nwhere |Σ| ≤ t &lt; Π, ◀▶ ∈ {◀, ▶}, S(j) is a Boolean combinations of P1 (j), ..., Pt (j), and K ⊆\n{1, ..., t}, one can construct in polynomial time a UHAT that recognizes the same language.\nProof sketch. Any Boolean combination of position-wise predicates can be simulated by a sequence\nof attention layers (each layer simply applies its affine map C to the current vector and disregards\nthe attention vector) and ReLU layers. For each B-RASP attention operation, we use a single UHA\nlayer (§ 2.2) whose mask predicate is M , whose tie-breaker matches ◀▶, whose affine maps A, B\ncompute the relevant components of the score, and whose affine map C combines the position’s\ninput vn with the attention-selected an . The value predicate V (i, j) is simulated as follows: the\nlayer’s affine map C copies the relevant components of ai —the layer-ℓ vector that attention selected\nfrom position o(i) (the unique position whose layer-ℓ vector wins the argmax in the UHA layer;\nequivalently, o(i) = τ (Bi ) in the UHAT notation of § 2.2, with Bi the argmax set among the\nunmasked positions and τ the tie-breaker)—into the layer’s output at position i, and a small ReLU\nsub-network applies the Boolean combination V to those copied components. The part S(j) of the\nscore predicate that only depends on j can be simulated using an additional\npreliminary layer that\nV\nalready computes the result of S(j) at every position j. For the part k∈K Pk (i) ↔ Pk (j) that\nchecks equality of two binary numbers, we provide a score function that maximizes the attention\nscore if the two binary numbers are equal. The full proof can be found in App. A.3.\n■\nProposition 10. The non-emptiness problem for UHAT is EXPSPACE-hard.\nProof. Together, Prop. 7, Lem. 8 and Lem. 9 imply the EXPSPACE lower bound for UHAT.\n7\n\n■\n\n\fCorollary 11. The non-emptiness problem for UHATs in which every layer uses strict future\nmasking and rightmost tie-breaking (or, dually, strict past masking and leftmost tie-breaking) is\nEXPSPACE-hard.\nProof. The B-RASP program constructed in Lem. 8 uses only strict future masking and rightmost tie-breaking, and it can be adapted to use only strict past masking and leftmost tie-breaking.7\nThe UHAT translation in Lem. 9 preserves the mask predicate and tie-breaking. Therefore the\nEXPSPACE lower bound established by Prop. 7, Lem. 8, and Lem. 9 transfers to UHATs in either\nof the two restricted classes.\n■\nWe now prove the upper bounds in Thm. 4. To this end, we first note that any B-RASP program\ncan be converted in exponential time into an LTL formula using the construction given by Yang\net al. (2024). In Prop. 13 we prove that the same holds true for UHATs, which improves the doubly\nexponential construction given by Yang et al. (2024) that translates UHATs into B-RASP programs\nfirst. These constructions suffice for the exponential-space upper bounds in Thm. 4 since nonemptiness of languages given by LTL formulas is in polynomial space (Sistla and Clarke, 1985).\nTo perform the translation from UHAT to LTL, we first have to make the crucial observation that the\nvalues occurring during the computation of a UHAT are not too large. The proof of the following\nproposition can be found in App. A.4.\nProposition 12. For every UHAT T , the precision required to evaluate T on any input is polynomial\nin |T |, i.e., every rational value arising in the computation of T can be represented with at most\npoly(|T |) bits.\nBy Prop. 12, the set of rationals that can arise in the computation of T is finite, and each member has\nbit-length polynomial in |T |. The set therefore has cardinality at most 2poly(|T |) , i.e., exponential\nin |T |, and can be enumerated in exponential time. This is precisely what makes the layer-by-layer\nLTL construction in the proof of Prop. 13 feasible: at each layer we have a finite, enumerable,\npolynomial-bit-length set of vectors to range over, which implies that the LTL formula only has to\nsimulate the position-wise behavior of attention layers, i.e., masking and selecting the position of\nthe attention vector, but not the actual computation of values.\nThe proof of the following proposition can be found in App. A.5.\nProposition 13. Given a UHAT T recognizing a language L ⊆ Σ+ , one can construct in exponential time an LTL formula φ that recognizes L.\nNote, if we start with a UHAT, where every attention layer uses strict future masking and leftmost\ntie-breaking (resp. strict past masking and rightmost tie-breaking), then the LTL formula constructed\nin the proof of Prop. 13 only uses the P (resp. F) operator. It was shown by Sistla and Clarke (1985)\nthat the non-emptiness problem for the fragments of LTL that only allow P or F is NP-complete.\nThus, we obtain an improved complexity upper bound for such restricted UHATs.\nCorollary 14. The non-emptiness problem for UHATs, where each attention layer uses strict future\nmasking/leftmost tie-breaking (resp. strict past masking/rightmost tie-breaking), is in NEXP.\nNote that it has been shown by Jerad et al. (2025) that such restricted UHATs are equally expressive\nas the LTL fragment with only P (respectively, F).8 However, the construction by Jerad et al. (2025)\nfrom UHAT to the LTL fragments incurs a doubly exponential blow-up, as opposed to our singly\nexponential translation. The full proof of Thm. 4, combining the preceding lemmas, propositions,\nand corollaries into the two directions of EXPSPACE-completeness, can be found in App. A.1.\n\n4\n\nS UCCINCTNESS ACROSS REPRESENTATIONS\n\nWe now study how succinctly transformers can represent languages compared to standard models\nfrom formal language theory. We first compare transformers to LTL. One suggestion that trans7\n\nIn case of strict past masking, we use the first coordinate in the acceptance condition.\nNote that LTL with a subset of the operators is often defined over EOS-padded strings; this choice affects\nits expressive capacity when using LTL with a subset of the operators. For instance, Li and Cotterell’s (2026)\ndemonstration that LTL[P] can not accept {a, b}∗ a with EOS-padding, but can without the padding.\n8\n\n8\n\n\fformers may be more succinct than LTL comes from Thm. 4, which shows that the non-emptiness\nproblem for UHATs is EXPSPACE-complete, whereas for LTL the corresponding problem is known\nto be PSPACE-complete. The following result shows that this exponential gap is also manifested in\nterms of the formalisms’ respective succinctness.\nTheorem 15. UHATs are exponentially more succinct than LTL.\nProof. It suffices to exhibit a witness family {Ln }∞\nn=1 together with UHATs Tn of size poly(n)\nrecognizing Ln such that every LTL formula recognizing Ln has size at least c1 2c2 n for constants\nc1 , c2 &gt; 0. Such a family is a witness in the sense of Def. 2: from |Tn | = poly(n), say |Tn | ≤ c0 nd ,\n′\n1/d\nwe get n ≥ (|Tn |/c0 )1/d , and substituting into |φn | ≥ c1 2c2 n gives |φn | ≥ c1 2c |Tn | for c′2 =\n′\n1/d\n1/d\nc2 /c0 . This witnesses f -more succinctness for f (m) = c1 2c2 m as required.\nPolynomial-size UHAT.\n\nThis direction proceeds in 3 steps.\n\n1. Let Mn bena (deterministic) Turing machine that implements a binary counter with\n2n bits, i.e.,\n2\n2n\nit writes 0 on its tape and increments the binary number until it has written 1 on its tape and\naccepts. In particular, Mn first checks that it was started with the empty tape and then writes\n2n many 0’s on its tape using an additional n-bit counter. To increment the 2n -bit counter, Mn\ntraverses the counter from left to right while flipping every 1 to 0 until it encounters the first 0,\nwhich is then flipped to 1. To initialize the counter with 0’s, Mn uses a linear number of states\nin n. Incrementing can be done with a constant-sized Turing machine. Moreover, Mn nuses an\nexponential number of tape cells in n and the unique accepting run has length at least 22 .\n2. Van Emde Boas (1997) gives a reduction from Turing machines to tiling problem instances that\nencodes configurations of Turing machines in its rows and a correct tiling corresponds to a valid\nexecution of the Turing machine. We observe that the 2p(n) -tiling problem instance In , for some\npolynomial p, constructed from Mnn has size polynomial in n and it has the property that the\nsmallest correct tiling has at least 22 many rows.\n3. Lem. 8 and Lem. 9 show that there is a UHAT Tn of size polynomial in the size of In that\nrecognizes encodings of correct tilings of Inn . Thus, Tn is of size polynomial in n and the\nsmallest accepted word has length at least 22 . We let Ln be the language recognized by Tn .\nExponential LTL lower bound. Let φn be an LTL formula that recognizes Ln . Because the\nsmallest accepted word by any LTL formula has length at most exponential in the formula size,\nusing an exponential conversion from LTL to finite automata similar to Vardi and Wolper (1994), it\nfollows that the size of φn is at least exponential in n.\n■\nConversely, the next result shows that UHATs have polynomially bounded expansion over LTL:\nevery LTL formula has an at most polynomially larger UHAT for the same language. Combined\nwith Thm. 15, this pins the gap between UHATs and LTL: at most polynomial universally, and at\nleast exponential on a witness family. The proof can be found in App. A.6.\nProposition 16. UHATs have polynomially bounded expansion over LTL. In particular, given an\nLTL formula φ, one can construct in polynomial time a UHAT T such that L(T ) = L(φ).\nWe show next that UHATs are doubly exponentially more succinct than finite automata.\nTheorem 17. UHATs are doubly exponentially more succinct than finite automata.\nProof. We reuse the witness family from Thm. 15: Ln is the language recognized by the UHAT\nTn constructed\nthere. Tn is of size polynomial in n and the smallest accepted word has length at\nn\nleast 22 . Because any automaton recognizing a non-empty language accepts a word of length at\nmost linear in the automaton size, the smallest automaton that recognizes Ln has size at least doubly\nexponential in n. Combined with |Tn | = poly(n), this exhibits the witness family required by Def. 2\nwith f doubly exponential.\n■\nConversely, the best known translation from counter-free automata—the class of finite automata\nequivalent to LTL—to LTL incurs an exponential blow-up (Maler and Pnueli, 1990). Composing this with Prop. 16 yields an at-most exponential-time translation from counter-free automata to\n9\n\n\fUHATs, which shows that UHATs have exponentially bounded expansion over finite automata when\nrestricted to the star-free languages. The translation in Yang et al. (2024) also incurs an exponential\nblow-up via Maler and Pnueli (1990).\nCombining Thm. 17 with Prop. 1 yields the following succinctness gap between UHATs and RNNs.\nCorollary 18. UHATs are exponentially more succinct than RNNs.\n\n5\n\nA PPLICATIONS\n\nAs a consequence of our results, we can show that reasoning about the language accepted by a\nUHAT, e.g., checking equivalence and emptiness, is intractable. Contrast this fact with deterministic finite automata, where these problems can be done in polynomial time (Kozen, 1997). As an\nexample, we give a precise statement about the complexity of equivalence problem, i.e., the problem\nof checking whether two UHATs recognize the same language. The proof can be found in App. A.7.\nTheorem 19. Deciding the equivalence between two UHATs is EXPSPACE-complete.\n\n6\n\nC ONCLUDING REMARKS\n\nRelated work. Our work directly draws upon a number of recent results (Yang et al., 2024; Barceló et al., 2024; Jerad et al., 2025; Li and Cotterell, 2025), which demonstrate the close connection between unique-hard attention transformers and LTL and, thus, the star-free regular languages.\nHowever, none of these results concerns succinctness and computational complexity of verification.\nCloser to our complexity-theoretic angle, Sälzer et al. (2025) studied the verification problem for\ntransformers of various precisions and showed that fixed-precision transformers are at least NEXPhard (i.e., hard for the class of problems solvable by nondeterministic algorithms that run in exponential time). Their technique implies that transformers can be (singly) exponentially more succinct\nthan finite automata, but yields no conclusion about their succinctness relative to representations like\nLTL or RNNs. Our results substantially improve on this by showing that transformers can be doubly\nexponentially more succinct than automata, and exponentially more succinct than LTL and RNNs.\nOur model is also simpler: we use unique-hard attention, whereas Sälzer et al. (2025) employs a\ncombination of soft and hard attention. Our setting also restricts positional information to positional\nmasking—a simple class of positional embeddings also considered by Yang et al. (2024), Jerad et al.\n(2025) and Li and Cotterell (2025)—in contrast to the arbitrary fixed-precision positional encodings\nadmitted by Sälzer et al. (2025). Without position encodings, Sälzer et al. (2026) recently showed\nthat verification is undecidable for average-hard-attention and softmax-attention transformers with\nfinite but unbounded precision.\nFormal Verification of Transformers. We close by situating our findings within the broader program of formal verification—the automated analysis, verification, and explanation of transformers—\nwhich is a central concern of explainable AI (Huang et al., 2020). Substantial practical progress has\nbeen made on verifying feed-forward neural networks, with tools developed over the last decade and\nbenchmarked at the annual VNN competition (Brix et al., 2024); transformers, by contrast, remain\nlargely out of reach. Despite the high worst-case complexity (EXPSPACE-complete), we pose as a\nchallenge bringing techniques from automated verification (Clarke et al., 2018)—symbolic methods,\nsimulation, inter alia—to bear on transformer verification in practice. Because our EXPSPACEhardness proof requires transformers that encode large counters, a complementary direction is to\nidentify subclasses that cannot encode such counters and thus admit lower-complexity verification.\nA related open question is the learnability of succinct transformers, on which the empirical evidence remains mixed (Garg et al., 2022; Naim et al., 2025; Huang et al., 2025). Finally, our results\nare a first step toward understanding how succinct transformers can be relative to other languageacceptor models, e.g., fixed-precision softmax transformers (Li and Cotterell, 2025), which UHATs\noverapproximate. We leave the succinctness of fixed-precision softmax and average-hard attention\ntransformers as future work; see Yang et al. (2026) for an initial attempt.\n10\n\n\fACKNOWLEDGMENTS\nWe thank David Chiang, Marco Sälzer, Andy Yang and anonymous reviewers for their helpful feedback. Pascal Bergsträßer and Anthony W. Lin are supported by Deutsche Forschungsgemeinschaft\n(grant number 522843867) and European Union9\n(ERC, LASD, 101089343).\n\nR EFERENCES\nPablo Barceló, Alexander Kozachinskiy, Anthony Widjaja Lin, and Vladimir V. Podolskii. 2024.\nLogical languages accepted by transformer encoders with hard attention. In International Conference on Learning Representations.\nPascal Bergsträßer, Chris Köcher, Anthony Widjaja Lin, and Georg Zetzsche. 2024. The power\nof hard attention transformers on data sequences: A formal language theoretic perspective. In\nAdvances in Neural Information Processing Systems.\nChristopher Brix, Stanley Bak, Taylor T. Johnson, and Haoze Wu. 2024. The fifth international\nverification of neural networks competition (VNN-COMP 2024): Summary and results.\nDavid Chiang and Peter Cholak. 2022. Overcoming a theoretical limitation of self-attention. In\nAnnual Meeting of the Association for Computational Linguistics.\nE.M. Clarke, O. Grumberg, D. Kroening, D. Peled, and H. Veith. 2018. Model Checking, 2 edition.\nMIT Press.\nShivam Garg, Dimitris Tsipras, Percy Liang, and Gregory Valiant. 2022. What can transformers\nlearn in-context? A case study of simple function classes. In Advances in Neural Information\nProcessing Systems.\nDavid Goldberg. 1991. What every computer scientist should know about floating-point arithmetic.\nACM Computing Surveys, 23(1).\nMartin Grohe and Nicole Schweikardt. 2004. The succinctness of first-order logic on linear orders.\nIn IEEE Symposium on Logic in Computer Science.\nAlbert Gu and Tri Dao. 2023. Mamba: Linear-time sequence modeling with selective state spaces.\nMichael Hahn. 2020. Theoretical limitations of self-attention in neural sequence models. Transactions of the Association for Computational Linguistics, 8.\nYiding Hao, Dana Angluin, and Robert Frank. 2022. Formal language recognition by hard attention\ntransformers: Perspectives from circuit complexity. Transactions of the Association for Computational Linguistics, 10.\nXiaowei Huang, Daniel Kroening, Wenjie Ruan, James Sharp, Youcheng Sun, Emese Thamo, Min\nWu, and Xinping Yi. 2020. A survey of safety and trustworthiness of deep neural networks: Verification, testing, adversarial attack and defence, and interpretability. Computer Science Review,\n37.\nXinting Huang, Andy Yang, Satwik Bhattamishra, Yash Raj Sarrof, Andreas Krebs, Hattie Zhou,\nPreetum Nakkiran, and Michael Hahn. 2025. A formal framework for understanding length generalization in transformers. In International Conference on Learning Representations.\nSelim Jerad, Anej Svete, Jiaoda Li, and Ryan Cotterell. 2025. Unique hard attention: A tale of two\nsides. In Annual Meeting of the Association for Computational Linguistics.\nDexter Kozen. 1997. Automata and Computability. Springer.\nJiaoda Li and Ryan Cotterell. 2025. Characterizing the expressivity of fixed-precision transformer\nlanguage models. In Advances in Neural Information Processing Systems.\n9\nViews and opinions expressed are however those of the author(s) only and do not necessarily reflect those\nof the European Union or the European Research Council Executive Agency. Neither the European Union nor\nthe granting authority can be held responsible for them.\n\n11\n\n\fJiaoda Li and Ryan Cotterell. 2026. Characterizing the expressivity of local attention in transformers. In Annual Meeting of the Association for Computational Linguistics.\nLeonid Libkin. 2004. Elements of Finite Model Theory. Springer.\nOded Maler and Amir Pnueli. 1990. Tight bounds on the complexity of cascaded decomposition of\nautomata. In Symposium on Foundations of Computer Science.\nRobert McNaughton and Seymour Papert. 1971. Counter-Free Automata. MIT Press.\nWilliam Merrill, Jackson Petty, and Ashish Sabharwal. 2024. The illusion of state in state-space\nmodels. In International Conference on Machine Learning.\nWilliam Merrill, Gail Weiss, Yoav Goldberg, Roy Schwartz, Noah A. Smith, and Eran Yahav. 2020.\nA formal hierarchy of RNN architectures. In Annual Meeting of the Association for Computational Linguistics.\nMarvin L. Minsky. 1967. Computation: Finite and Infinite Machines. Prentice-Hall.\nOmar Naim, Jerome Bolte, and Nicholas Asher. 2025. Analyzing limits for in-context learning. In\nWhat Can(’t) Transformers Do? Workshop at the Conference on Neural Information Processing\nSystems.\nJorge Pérez, Pablo Barceló, and Javier Marinkovic. 2021. Attention is Turing-complete. Journal of\nMachine Learning Research, 22.\nAmir Pnueli. 1977. The temporal logic of programs. In Symposium on Foundations of Computer\nScience.\nMarco Sälzer, Eric Alsmann, and Martin Lange. 2025. Transformer encoder satisfiability: Complexity and impact on formal reasoning. In International Conference on Learning Representations.\nMarco Sälzer, Chris Köcher, Alexander Kozachinskiy, Georg Zetzsche, and Anthony Widjaja Lin.\n2026. The counting power of transformers. In International Conference on Learning Representations.\nFrançois Schwarzentruber. 2019.\narXiv:1907.00102.\n\nThe complexity of tiling problems.\n\narXiv preprint\n\nHava T. Siegelmann and Eduardo D. Sontag. 1995. On the computational power of neural nets.\nJournal of Computer and System Sciences, 50(1).\nMichael Sipser. 1997. Introduction to the Theory of Computation. PWS Publishing.\nA. Prasad Sistla and Edmund M. Clarke. 1985. The complexity of propositional linear temporal\nlogics. Journal of the ACM, 32(3).\nLarry Joseph Stockmeyer. 1974. The Complexity of Decision Problems in Automata Theory and\nLogic. Ph.D. thesis, Massachusetts Institute of Technology.\nHoward Straubing. 1994. Finite Automata, Formal Logic, and Circuit Complexity. Birkhäuser.\nLena Strobl, William Merrill, Gail Weiss, David Chiang, and Dana Angluin. 2024. What formal\nlanguages can transformers express? A survey. Transactions of the Association for Computational\nLinguistics, 12.\nAnej Svete and Ryan Cotterell. 2023. Recurrent neural language models as probabilistic finite-state\nautomata. In Conference on Empirical Methods in Natural Language Processing.\nPeter van Emde Boas. 1997. The convenience of tilings. In Complexity, Logic, and Recursion\nTheory. CRC Press.\nMoshe Y. Vardi and Pierre Wolper. 1994. Reasoning about infinite computations. Information and\nComputation, 115(1).\n12\n\n\fAshish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez,\nLukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in Neural\nInformation Processing Systems.\nGail Weiss, Yoav Goldberg, and Eran Yahav. 2018. On the practical computational power of finite\nprecision RNNs for language recognition. In Annual Meeting of the Association for Computational Linguistics.\nGail Weiss, Yoav Goldberg, and Eran Yahav. 2024. Extracting automata from recurrent neural\nnetworks using queries and counterexamples (extended version). Machine Learning, 113(5).\nAndy Yang, Pascal Bergsträßer, Georg Zetzsche, David Chiang, and Anthony Widjaja Lin. 2026.\nLength generalization bounds for transformers. Preprint, arXiv:2603.02238. (Accepted at\nICML’26).\nAndy Yang, David Chiang, and Dana Angluin. 2024. Masked hard-attention transformers recognize\nexactly the star-free languages. In Advances in Neural Information Processing Systems.\nHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin, Omid Saremi, Joshua M. Susskind, Samy\nBengio, and Preetum Nakkiran. 2024. What algorithms can transformers learn? A study in length\ngeneralization. In International Conference on Learning Representations.\n\n13\n\n\fA\n\nP ROOFS\n\nA.1\n\nP ROOF OF T HEOREM 4\n\nTheorem 4. The non-emptiness problem for UHATs and B-RASP programs is EXPSPACEcomplete.\nProof. The theorem asserts EXPSPACE-completeness of the non-emptiness problem for two formalisms simultaneously: B-RASP programs and UHATs. We prove the two directions of completeness separately.\nHardness (lower bound).\ntransfer it to UHATs.\n\nWe establish EXPSPACE-hardness first for B-RASP programs, then\n\n• B-RASP. For B-RASP programs, Prop. 7 states that the 2N -tiling problem is EXPSPACEcomplete, so it is EXPSPACE-hard. By Lem. 8, any instance of the 2N -tiling problem can be\ntransformed, in time polynomial in N , into a B-RASP program whose recognized language\nis non-empty if and only if the original tiling instance has a solution. Composing these two\nresults yields a polynomial-time reduction from an EXPSPACE-hard problem to B-RASP nonemptiness. Thus, B-RASP non-emptiness is itself EXPSPACE-hard.\n• UHAT. For UHATs, we further compose the previous reduction with the polynomial-time,\nlanguage-preserving translation from B-RASP to UHATs of Lem. 9. The composed reduction\nis again polynomial-time, so the EXPSPACE-hardness of 2N -tiling transfers to UHAT nonemptiness; this is the content of Prop. 10.\nMembership (upper bound). We show that the non-emptiness problem for both formalisms lies\nin EXPSPACE by translating to LTL and invoking the Sistla–Clarke decision procedure.\nFor B-RASP programs, the construction of Yang et al. (2024) converts any B-RASP program P\ninto an equivalent LTL formula φP in time exponential in |P |; consequently |φP | is itself at most\nexponential in |P |.\nFor UHATs, the analogous translation is supplied by Prop. 13, which turns any UHAT T into an\nequivalent LTL formula φT in exponential time (and hence of at most exponential size). The proof\nof Prop. 13 relies crucially on Prop. 12: the latter guarantees that all rational values arising in the\ncomputation of T admit representations of polynomially many bits, which is what makes the set of\nlayer-wise representations enumerable in exponential time.\nIn both cases we have, in exponential time, reduced the original non-emptiness problem to LTL\nsatisfiability for a formula of size at most exponential in the size of the original UHAT or B-RASP\nprogram. Sistla and Clarke (1985) prove that LTL satisfiability is decidable in space polynomial in\nthe formula size; applied to φP or φT , this uses space polynomial in an exponential quantity, that\nis, space exponential in |P | or |T |. The overall decision procedure therefore runs in EXPSPACE.\nCombining the two halves yields EXPSPACE-completeness of non-emptiness for both B-RASP\nprograms and UHATs, as claimed.\n■\nA.2\n\nP ROOF OF L EMMA 8\n\nLemma 8. Given a 2N -tiling problem instance, one can construct in time polynomial in N a BRASP program, whose language is non-empty iff the 2N -tiling problem instance has a solution.\nProof. Fix a 2N -tiling problem instance I = (N, T, tfin ) as in Prob. 6. We construct a B-RASP\nprogram PI of size polynomial in N and |T | such that L(PI ) ̸= ∅ if and only if I admits a solution\nτ : [2N ] × [M ] → T in the sense of Prob. 6.\nEncoding. We encode a candidate τ as a word over the alphabet Σ := T ∪ {0, 1, #}. Define the\nper-cell encoding enc : [2N ] × [M ] → Σ+ by\nenc(i, j) := binN (i − 1) τ (i, j) #,\n14\n\n(10)\n\n\fwhere binN (i − 1) ∈ {0, 1}N is the N -bit binary representation of i − 1, most significant bit first.\nThe encoding of the full configuration scans columns within each row in order:\nenc(τ ) := enc(1, 1)... enc(2N , 1) enc(1, 2)... enc(2N , M ).\n\n(11)\n\nLet LI := {enc(τ ) | τ is a solution of I}. It suffices to construct a B-RASP program that\nrecognizes LI .\nPlan. Throughout, let a = a1 ... aL ∈ Σ+ denote the input, with L := |a|. We build PI as a\nconjunction of five gadgets, each evaluated at the last position L:\n• Gadget A—shape: a ∈ ({0, 1}N T #)∗ .\n• Gadget B—column counter: consecutive N -bit blocks count 0, 1, ..., 2N − 1, 0, ....\n• Gadget C—final tile: a ends with 1N tfin # (Item 1).\n• Gadget D—boundary conditions: Item 2 and Item 3.\n• Gadget E—adjacency: Item 4 and Item 5.\nThe output predicate is Y (i) := A(i) ∧ B(i) ∧ C(i) ∧ D(i) ∧ E(i), and PI accepts a iff Y (L) = 1.\nWe define each gadget below and verify its soundness at L.\nGadget A: well-formed shape. To check whether a ∈ ({0, 1}N T #)∗ , we construct the\nfollowing B-RASP predicates:\n_\nAT (i) := ▶j [j &lt; i, 1]\nQt (j) : 0\n(12a)\nt∈T\n\nAbit,1 (i) := ▶j [j &lt; i, 1] Q0 (j) ∨ Q1 (j) : 0\nAbit,k (i) := ▶j [j &lt; i, 1] Abit,k−1 (j) : 0\nfor k = 2, ..., N\nA#,1 (i) := ▶j [j &lt; i, 1] Q# (j) : 1\nA#,k (i) := ▶j [j &lt; i, 1] A#,k−1 (j) : 1\nfor k = 2, ..., N + 1\n!\n!\n!\nN\n_\n^\nAenc (i) := (Q# (i) → AT (i)) ∧\nQt (i) →\nAbit,k (i) ∧ A#,N +1 (i)\nt∈T\n\n(12b)\n(12c)\n(12d)\n(12e)\n(12f)\n\nk=1\n\nWe aggregate Aenc across all positions:\nA(i) := ▶j [j &lt; i, ¬Aenc (j)] 0 : Aenc (i).\n\n(13)\n\nThen A(L) = 1 iff Aenc (i) = 1 at every position, which holds iff a matches ({0, 1}N T #)∗ up to\nthe requirement that the last symbol is #, which is enforced by Gadget C below.\nGadget B: column counter. We check that the N -bit binary blocks separated by # encode the\nintegers 0, 1, ..., 2N − 1, 0, ... in order, generalizing the increment predicate of Ex. 2 from 4 bits to\nN bits.\nB1 (i) := ▶j [j &lt; i, Q0 (j) ∨ Q1 (j)] Q1 (j) : 0\nBk (i) := ▶j [j &lt; i, Q0 (j) ∨ Q1 (j)] Bk−1 (j) : 0\nfor k = 2, ..., N\nN\nk−1\n_\u0010^\nB+1 (i) := ▶j [j &lt; i, Q# (j)]\n¬Br (i) ∧ Br (j)\nk=1\n\n∧ Bk (i) ∧ ¬Bk (j) ∧\n\n(14a)\n(14b)\n\nr=1\nN\n^\n\n\u0011\nBr (i) ↔ Br (j) : 0\n\n(14c)\n\nr=k+1\n\nB1→0 (i) := ▶j [j &lt; i, Q# (j)]\n\nN\n^\n\n¬Bk (i) ∧ Bk (j) :\n\nk=1\n\nN\n^\n\n¬Bk (i)\n\n(14d)\n\nk=1\n\nB(i) := ▶j [j &lt; i, Q# (j) ∧ ¬B1→0 (j) ∧ ¬B+1 (j)] 0 : B1→0 (i) ∧ B+1 (i)\nThen B(L) = 1 iff the binary blocks count up correctly.\n15\n\n(14e)\n\n\fGadget C: final tile. For each tile t ∈ T , we record whether the most recent prior tile equals t\nvia the predicate Tt at every position, and use this to check that a ends with 1N tfin # (Item 1):\n_\nTt (i) := ▶j [j &lt; i,\nQt′ (j)] Qt (j) : 0\nfor all t ∈ T\n(15a)\nt′ ∈T\n\nC(i) := Q# (i) ∧ Ttfin (i) ∧\n\nN\n^\n\nBk (i)\n\n(15b)\n\nk=1\n\nThen C(L) = 1 iff a ends with 1N tfin #.\nGadget D: boundary conditions. We enforce Item 2 and Item 3 of Prob. 6: the bottom row uses\ntiles with down = 0, the top row uses tiles with up = 0, and the leftmost (resp. rightmost) column\nuses tiles with left = 0 (resp. right = 0).\nD⊥ (i) := ▶j [j &lt; i, Q# (j) ∧\n\nN\n^\n\nBk (i) ↔ Bk (j)] 1 :\n\nk=1\n\n\nN\n^\n\nh\n\n _\nD⊤ (i) := ▶j j &lt; i, Q# (j) ∧ \nTt (j) ∨\n\nt∈T,\nup(t)̸=0\n\nk=1\n\n_\n\nTt (i)\nt∈T,\ndown(t)=0\n\n(16a)\n\n\n!\ni\n¬Bk (j) \n\n\n\n\n\n\n\n\n\n\n _\n  _\n\n\n\nTt (j)\nTt (i)\n\n∧\n:0\nt∈T,\nup(t)=0\n\nN\n^\n\nD⊢ (i) :=\n\n!\n¬Bk (i)\n\n→\n\n_\n\nTt (i)\nt∈T,\nleft(t)=0\n\n(16c)\n\n→\n\n_\n\n(16d)\n\nk=1\nN\n^\n\nD⊣ (i) :=\n\nk=1\n\n(16b)\n\nt∈T,\nup(t)=0\n\n!\nBk (i)\n\nTt (i)\nt∈T,\nright(t)=0\n\nD(i) := ▶j [j &lt; i, Q# (j) ∧ ¬ (D⊥ (j) ∧ D⊢ (j) ∧ D⊣ (j))] 0 : D⊥ (i) ∧ D⊤ (i) ∧ D⊢ (i) ∧ D⊣ (i)\n(16e)\nThen D(L) = 1 iff Item 2 and Item 3 hold.\nGadget E: adjacency. We enforce Item 4 and Item 5: horizontally adjacent tiles agree on\n(right, left), and vertically adjacent tiles (same column, consecutive rows) agree on (down, up) as\nfollows:\n!\nN\n_\n_\nE← (i) := ▶j [j &lt; i, Q# (j)]\nBk (i) →\n(Tt (i) ∧ Tt′ (j)) : 1\n(17a)\nt,t′ ∈T,\nleft(t)=right(t′ )\n\nk=1\n\nE↓ (i) := ▶j [j &lt; i, Q# (j) ∧\n\nN\n^\n\nBk (i) ↔ Bk (j)]\n\n_\n\nTt (i) ∧ Tt′ (j) : 1\n\n(17b)\n\n′\n\nk=1\n\nt,t ∈T,\ndown(t)=up(t′ )\n\nE(i) := ▶j [j &lt; i, Q# (j) ∧ ¬ (E↓ (j) ∧ E← (j))] 0 : E↓ (i) ∧ E← (i)\n\n(17c)\n\nThen E(L) = 1 iff Item 4 and Item 5 hold.\nWrap-up.\n\nDefine the output predicate\nY (i) := A(i) ∧ B(i) ∧ C(i) ∧ D(i) ∧ E(i),\n16\n\n(18)\n\n\fand let PI accept iff Y (L) = 1. By the soundness of each gadget, L(PI ) = LI , so L(PI ) ̸= ∅ iff\nI admits a solution. Each gadget uses O(N ) predicates of size polynomial in N and |T |, so |PI |\nis polynomial in N and |T |, hence in the size of I.\n■\nA.3\n\nP ROOF OF L EMMA 9\n\nLemma 9. Given a B-RASP program P1 , ..., PΠ where every attention operation is of the form\n^\nPt+1 (i) := ◀▶j [M (i, j), S(j) ∧\nPk (i) ↔ Pk (j)] V (i, j) : D(i),\n(9)\nk∈K\n\nwhere |Σ| ≤ t &lt; Π, ◀▶ ∈ {◀, ▶}, S(j) is a Boolean combinations of P1 (j), ..., Pt (j), and K ⊆\n{1, ..., t}, one can construct in polynomial time a UHAT that recognizes the same language.\nProof. Let P = (P1 , ..., PΠ ) be a B-RASP program over the alphabet Σ = {a1 , ..., a|Σ| }, where Pt\nis the initial vector Qat for all 1 ≤ t ≤ |Σ|. We construct a UHAT over Σ that recognizes the same\nlanguage as P . We use a one-hot symbol embedding emb : Σ → {0, 1}|Σ| , i.e., emb(at ) := et for\nall 1 ≤ t ≤ |Σ|, where et denotes the tth unit vector. Then Pt (i) coincides with the tth component\nof the ith input vector of the UHAT after the symbol embedding is applied. The UHAT will preserve\nthese components in each layer and will gradually add new components to store the value of Pt (i)\nfor all |Σ| &lt; t ≤ Π. So assume we already defined the layers of the UHAT that compute the vector\n(P1 (i), ..., Pt (i)) at position i for |Σ| ≤ t &lt; Π. We now define additional layers whose output will\nbe (P1 (i), ..., Pt+1 (i)).\nWe first consider the case where Pt+1 is a position-wise operation, i.e., Pt+1 (i) is defined by a\nBoolean combination of P1 (i), ..., Pt (i). We define UHAT layers to compute the result of that\nBoolean combination bottom-up. Assume we already defined layers that output (R1 (i), ..., Rs (i)),\nwhere s ≥ t and R1 (i), ..., Rs (i) contain P1 (i), ..., Pt (i) and the results of previously computed\nsubformulas. To compute the result of ¬Rk (i) for some k ∈ [s], we add an attention layer that\njust forwards 1 − Rk (i) at position i in an additional component while leaving the first s components unchanged. To compute Rk (i) ∧ Rℓ (i) for some k, ℓ ∈ [s], we first use an attention layer\nto forward Rk (i) + Rℓ (i) − 1 in an additional component followed by a ReLU layer that forwards\nthe result of max{0, Rk (i) + Rℓ (i) − 1} in this additional component, again leaving the first s\ncomponents unchanged. We do not have to deal with Rk (i) ∨ Rℓ (i), since it can be rewritten as\n¬(¬Rk (i) ∧ ¬(Rℓ (i)). After computing the results of all subformulas, we add an additional attention layer to only forward (P1 (i), ..., Pt+1 (i)), i.e., removing the intermediate results. Observe that\na Boolean combination has only linearly many subformulas.\nLet us now consider the case where Pt+1 is an attention operation of the form\n^\nPt+1 (i) := ◀▶j [M (i, j), S(j) ∧\nPk (i) ↔ Pk (j)] V (i, j) : D(i)\n\n(19)\n\nk∈K\n\nas in the statement of Lem. 9. Throughout the construction below, K, M , ◀▶, S, V , and D are\nthe parameters of this input attention operation, as bound in the lemma statement; in particular,\nK ⊆ {1, ..., t} is the index set of predicates whose values at i and j are compared for equality\nin the operation’s score predicate. We first use additional layers as in the case of position-wise\noperations to compute the result of ¬S(i) at every position i in an additional component to output\n(P1 (i), ..., Pt (i), 1 − S(i)). Next we use an attention layer to add the result of 1 − Pk (i) for all\nk ∈ K at every position i in additional components. We then add an attention layer that uses mask\npredicate M , tie-breaking according to ◀▶, and attention score\n\u0010X\n\u0001\u0011\n\u0001\nPk (i)Pk (j) + (1 − Pk (i))(1 − Pk (j)) − 1 − S(j)\n(20)\nk∈K\n\nwhich is equal to |{k ∈ K | Pk (i) = Pk (j)}| − (1 − S(j)) since\n\u001a\n1, if Pk (i) = Pk (j)\nPk (i)Pk (j) + (1 − Pk (i))(1 − Pk (j)) =\n0, otherwise.\n\n(21)\n\nThus, the score is maximized (equal to |K|) if Pk (i) = Pk (j) for all k ∈ K and S(j) = 1. For every\nposition i let o(i) be the position of the vector that maximizes the attention score with respect to i.\n17\n\n\fThe attention layer forwards the vector (P1 (i), ..., Pt (i), P1 (o(i)), ..., Pt (o(i)), S(o(i))) at position\ni. We now compute the result of\n^\nR(i) := S(o(i)) ∧\nPk (i) ↔ Pk (o(i))\n(22)\nk∈K\n\nat every position i as in the case of position-wise operations and forward the vector\n(P1 (i), ..., Pt (i), P1 (o(i)), ..., Pt (o(i)), R(i)). Finally, we compute\n\u0001\n\u0001\nR(i) ∧ V (i, o(i)) ∨ ¬R(i) ∧ D(i)\n(23)\nby again using additional layers as in the case of position-wise operations, whose result is exactly\nPt+1 (i). We then forward (P1 (i), ..., Pt+1 (i)).\nIt remains to describe when the UHAT accepts. If Pt is the output vector of P , then we stop the\nconstruction of the UHAT after the layers to compute Pt are constructed. The acceptance vector of\nthe UHAT is then defined as et , i.e., the tth unit vector. This means that the UHAT accepts if and\nonly if ⟨et , (P1 (N ), ..., Pt (N ))⟩ &gt; 0, which holds if and only if Pt (N ) = 1, where N is the length\nof the input.\nWe observe that the resulting UHAT only has polynomially many layers since the result of each\noperation Pt can be computed using an additional number of layers that is linear in the description\nsize of Pt .\n■\nA.4\n\nP ROOF OF P ROPOSITION 12\n\nProposition 12. For every UHAT T , the precision required to evaluate T on any input is polynomial\nin |T |, i.e., every rational value arising in the computation of T can be represented with at most\npoly(|T |) bits.\nProof. Part 1: bounding the denominator. Let K be the number of rationals in the description\nof T , i.e., the entries of the embedding emb(a) for a ∈ Σ, the entries of every affine transformation\nAℓ , Bℓ , Cℓ at each layer ℓ, and the entries of the acceptance vector t. Each of these rationals is part\nof T ’s binary encoding, so K ≤ |T | and the bit-length b of any individual rational satisfies b ≤ |T |\nas well. Let D be the least common multiple (LCM) of the denominators of those K rationals. The\nLCM of K integers each of bit-length at most b has bit-length at most K · b (an upper bound is the\nproduct of the integers), so D has bit-length at most |T |2 . By construction, every embedding entry\nand every coefficient of an affine transformation can be written with denominator dividing D.\nWe now show by induction on the layer number ℓ that there is a denominator dℓ , of polynomial bitdef\nlength, common to every value at layer ℓ. The base case ℓ = 0 is the embedding: d0 = D works. For\nthe inductive step, suppose every layer-ℓ value has denominator dividing dℓ . An attention layer takes\nan affine combination of layer-ℓ values, weighted by coefficients drawn from the description of T .\nEach weight has denominator dividing D, and each input has denominator dividing dℓ . The product\nof two fractions with denominators dividing D and dℓ has denominator dividing D · dℓ ; a sum of\nsuch products and the bias term (denominator dividing D, which divides D · dℓ ) shares the same\ndef\ndenominator. So we may take dℓ+1 = D · dℓ . A ReLU layer applies max{0, ·} pointwise, which\ndef\nleaves denominators unchanged, so dℓ+1 = dℓ suffices for that case. Iterating over at most |T | many\nlayers, the final denominator is at most D|T |+1 , with bit-length (|T | + 1) log D, polynomial in |T |.\nPart 2: bounding the numerator. At an attention layer of width R, each output numerator is\nan affine combination of 2R layer-ℓ numerators with integer weights and a bias each of bit-length\nat most log D (the entries of C scaled by D). The magnitude is therefore at most 2R · 2log D\ntimes the largest layer-ℓ numerator’s magnitude—an additive per-layer bit-length increase of\nlog R + log D + O(1); ReLU leaves bit-lengths unchanged. Since layer-0 numerators have\nbit-length at most |T | + log D, iterating across the at-most-|T | many layers gives a final bit-length\nof O(|T | · (log R + log D)), polynomial in |T |.\nNote that the additive (rather than multiplicative) per-layer growth above follows because the\nforwarded vector at an attention layer is C(vn , an ), an affine combination of two layer-ℓ vectors:\n18\n\n\fthe position’s own input vn and the attention-selected an = vτ (Bn ) , which is just a verbatim\ncopy of whichever existing layer-ℓ vector τ picks. The score function S(vn , ·)—including the dot\nproduct—does enter the picture and a single score value would have bit-length quadratic in its\ninputs. But the score is used only to rank positions; the argmax reduces it to a position index, and\nthat index alone is used to fetch an . The score’s value never becomes a coordinate of any forwarded\nvector, so its quadratic bit-length never enters the next layer’s input.\nCombining the two parts: every value produced by T on any input has the form p/q with p and q\neach of bit-length polynomial in |T |.\n■\nA.5\n\nP ROOF OF P ROPOSITION 13\n\nProposition 13. Given a UHAT T recognizing a language L ⊆ Σ+ , one can construct in exponential time an LTL formula φ that recognizes L.\nProof. Setup. Let T be a UHAT recognizing a language L ⊆ Σ+ and let F be the set of binary\nrepresentations of rational numbers that may occur during the computation of T , as in Prop. 12. For\nthe ℓth layer of T and every v ∈ F S , where S is the output dimension of layer ℓ, we construct an\nLTL formula φℓv such that, on input a = a1 ... aN ∈ Σ+ , the ℓth layer outputs v at position n ∈ [N ]\nif and only if a, n |= φℓv . We define φℓv inductively on ℓ.\nBase case (ℓ = 0).\n\nLet emb : Σ → QD be the symbol embedding of T , and for all v ∈ F D let\n_\n\nQa , if emb−1 (v) ̸= ∅\n\n0\n−1\nφv := a∈emb (v)\n(24)\n\n⊥,\notherwise.\n\nWe now define the formula for layer ℓ + 1, splitting on the type of layer.\nInductive step—ReLU layer.\ncoordinate, we set\n\nIf layer ℓ + 1 is a ReLU layer of width R applying ReLU to the k th\n:=\nφℓ+1\nv\n\n_\n\nφℓ(v1:k−1 , u, vk+1:R )\n\n(25)\n\nu∈F,\nmax{0,u}=vk\n\nfor all v ∈ F R .\nInductive step—attention with strict masking. If layer ℓ + 1 is an attention layer with strict\nfuture masking and rightmost tie-breaking defined by an affine transformation C : Q2R → QS and\na score function S : Q2R → QR , we let\n\u0010\u0010\n_\n_ \u0011 \u0010\n_ \u0011\u0011\n:=\nφℓ+1\nφℓu ∧\nφℓb S φℓa ∧ ¬P\nφℓb\n(26)\nv\nu,a∈F R ,\nC(u,a)=v\n\nb∈F R ,\nS(u,b)&lt;S(u,a)\n\nb∈F R ,\nS(u,b)&gt;S(u,a)\n\nfor all v ∈ F S . To account for the special case where the set of unmasked positions is empty, we\ntake the disjunction of the previous formula with\n_\n(¬P⊤) ∧\nφℓu .\n(27)\nu∈F R ,\nC(u,0)=v\n\nWe omit this special case in what follows. If the layer uses leftmost tie-breaking instead, we adapt\nthe formula as follows:\n\u0010 \u0010\n_\n_ \u0011\u0011 \u0010\n_ \u0011\nℓ\nℓ\nℓ\n:=\nφℓb\n(28)\nφℓ+1\nφ\n∧\nP\nφ\n∧\n¬P\nφ\n∧\n¬P\nv\nu\na\nb\nu,a∈F R ,\nC(u,a)=v\n\nb∈F R ,\nS(u,b)≥S(u,a)\n\nb∈F R ,\nS(u,b)&gt;S(u,a)\n\nThe case of strict past masking is similar, with U in place of S and F in place of P.\n19\n\n\fInductive step—attention without masking. If the layer uses no masking and rightmost tiebreaking, we distinguish three cases according to where the attention vector lies relative to the\ncurrent position: at the current position, strictly to the left, or strictly to the right. When the attention\nvector is at the current position, we define φℓ+1\nv,at as\n\u0010\n_\n_ \u0011 \u0010\n_ \u0011\nφℓu ∧ ¬P\nφℓb ∧ ¬F\nφℓb .\nφℓ+1\n(29)\nv,at :=\nu∈F R ,\nC(u,u)=v\n\nb∈F R ,\nS(u,b)&gt;S(u,u)\n\nb∈F R ,\nS(u,b)≥S(u,u)\n\nWhen the attention vector is strictly to the left of the current position, we define φℓ+1\nv,L as\n\u0010\n_ \u0011\u0011\n_ \u0011 \u0010\n_ \u0011 \u0010\u0010\n_\nφℓb .\nφℓb S φℓa ∧ ¬P\nφℓb ∧\nφℓu ∧ ¬F\nφℓ+1\nv,L :=\nu,a∈F R ,\nC(u,a)=v,\nS(u,a)&gt;S(u,u)\n\nb∈F R ,\nS(u,b)≥S(u,a)\n\nb∈F R ,\nS(u,b)&lt;S(u,a)\n\nSimilarly, when the attention vector is strictly to the right, we define φℓ+1\nv,R as\n\u0010\n_ \u0011 \u0010 \u0010\n_ \u0011\u0011 \u0010\n_\nφℓb ∧ F φℓa ∧ ¬F\nφℓb ∧ ¬F\nφℓu ∧ ¬P\nφℓ+1\nv,R :=\nu,a∈F R ,\nC(u,a)=v,\nS(u,a)≥S(u,u)\n\nb∈F R ,\nS(u,b)&gt;S(u,a)\n\nb∈F R ,\nS(u,b)≥S(u,a)\n\n(30)\n\nb∈F R ,\nS(u,b)&gt;S(u,a)\n\n_\n\n\u0011\nφℓb . (31)\n\nb∈F R ,\nS(u,b)&gt;S(u,a)\n\nIn the case of no masking and rightmost tie-breaking, we set\nℓ+1\nℓ+1\n:= φℓ+1\nφℓ+1\nv\nv,at ∨ φv,L ∨ φv,R .\n\n(32)\n\nThe case of no masking and leftmost tie-breaking is analogous.\nAcceptance formula. If T has m layers whose last layer outputs vectors of dimension S, and\nt ∈ QS is its acceptance vector, we define\n_\nφm\n(33)\nφ :=\nv .\nv∈F S ,\n⟨t,v⟩&gt;0\n\nThen a, N |= φ if and only if a ∈ L.\nComplexity. It remains to argue that φ can be computed in exponential time. By Prop. 12, |F |\nis exponential in |T | and every representation in F has polynomial bit-length; moreover, F can\nbe computed in exponential time. At every layer ℓ + 1 of width R, the formula φℓ+1\ndepends on\nv\n|F |O(R) formulas from layer ℓ, and can be computed in time polynomial in |F |R · |T |, since we\nonly have to evaluate affine transformations on vectors from F R , each of polynomial bit-length.\nO(R′ m)\nAt the last layer m, the formulas φm\nformulas from layer 0, where R′ is the\nv depend on |F |\nm\nmaximum layer width. Hence φv , and therefore φ, has size exponential in |T | and is computable\nin exponential time.\n■\nA.6\n\nP ROOF OF P ROPOSITION 16\n\nProposition 16. UHATs have polynomially bounded expansion over LTL. In particular, given an\nLTL formula φ, one can construct in polynomial time a UHAT T such that L(T ) = L(φ).\nProof sketch. We construct T by induction on the subformula structure of φ, maintaining the following invariant: after processing a subformula ψ, the UHAT built so far has, at every position n of\nany input a, a designated output coordinate carrying the truth value of a, n |= ψ. Once the invariant\nis established for ψ = φ, the acceptance vector reads off that coordinate at the last position.\nAtomic formulas. For φ = Qa , the token embedding already provides the indicator 1[an = a] at\neach position, which is precisely the required truth value.\nBoolean combinations. The truth value of ¬ψ, ψ1 ∧ ψ2 , or ψ1 ∨ ψ2 at position n depends only on\nthe children’s truth values at the same position n, so a single affine-and-ReLU layer computes the\nrequired coordinate point-wise from coordinates produced by the inductive hypothesis.\n20\n\n\fSince (φ = φ1 S φ2 ). By inductive hypothesis we have coordinates for φ1 and φ2 at every position;\nan affine-and-ReLU layer computes ¬φ1 ∨ φ2 at every position. We then use an attention layer with\nstrict future masking and rightmost tie-breaking to get for every position i the maximal position\nj &lt; i where ¬φ1 ∨ φ2 holds and output at position i the truth value of φ2 from position j. For\npositions ℓ and subformulas ψ, we write ψ(ℓ) ∈ {0, 1} for the indicator of a, ℓ |= ψ. By the\nmaximality of j, every k with j &lt; k &lt; i satisfies φ1 (k) ∧ ¬φ2 (k) (otherwise k would be a more\nrecent witness); in particular φ1 (k) holds for all k ∈ (j, i). Thus if φ2 (j) = 1, then j witnesses\nφ1 S φ2 at i under the semantics of § 2, and if φ2 (j) = 0 then ¬φ1 (j) = 1 blocks any earlier j ′ ≤ j\nfrom witnessing S at i. When no such j exists, the attention layer’s default value outputs 0, which is\nagain consistent with the semantics.\nThe case where φ = φ1 U φ2 is similar using strict past masking and leftmost tie-breaking.\nA.7\n\n■\n\nP ROOF OF T HEOREM 19\n\nTheorem 19. Deciding the equivalence between two UHATs is EXPSPACE-complete.\nProof. To prove the lower bound, we reduce from the non-emptiness problem for UHATs, which\nby Thm. 4 is EXPSPACE-complete. To this end, let T be a given UHAT and fix a UHAT T0\nthat recognizes the empty language. Then we have that T and T0 are equivalent if and only if T\nrecognizes the empty language.\nTo prove the upper bound, let the UHATs T1 and T2 be given. We apply Prop. 13 to turn T1 and T2\nin exponential time into LTL formulas φ1 and φ2 , respectively. Now, T1 and T2 are equivalent if and\nonly if φ1 and φ2 are equivalent. The latter can be decided in polynomial space (Sistla and Clarke,\n1985), which results in an exponential-space algorithm in total.\n■\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"