Shoonya:面向图数据库的零套接字进程内小语言模型,具有模式纪元KV缓存、实时目录逻辑掩码和验证器优势蒸馏 Shoonya: Zero-Socket In-Process Small Language Models for Graph Databases with Schema-Epoch KV Caching, Live Catalog Logit Masking, and Verifier-Advantage Distillation 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-11-21
👁️ 预览文献
💡 AI 中文简介
Shoonya 将小语言模型直接嵌入图数据库进程,避免外部服务器通信开销。它用模式缓存加速预填充,用实时目录掩码确保输出合法,并在内存中运行。实验显示首令牌时间提升4.91-13.68倍,内存仅389.8 MiB,无幻觉泄漏,并在代码生成任务上提升13.61个MBPP点。
领域数据库与人工智能交叉,图数据库内嵌语言模型
适合谁读需要一定专业背景(数据库系统、语言模型推理优化)
核心贡献1. 提出零套接字进程内推理架构,利用数据库原生原语(模式纪元缓存、实时目录掩码、MVCC门控)显著降低延迟和内存。2. 设计验证器优势门控知识蒸馏(AdvKD)解决蒸馏陷阱,提升代码生成性能。
关键数据首令牌时间加速4.91-13.68倍;内存占用389.8 MiB INT8;吞吐59.8-67.9 tok/s;幻觉泄漏0.0%;MBPP提升13.61点(33.07%);KV内存减少93.75%;词汇权重减少74.5%。
推荐理由如果你对数据库内嵌AI或高效推理感兴趣,这篇工作展示了如何将语言模型无缝集成到图数据库中,性能提升显著且资源占用低,值得一读。
关键词["图数据库", "小语言模型", "进程内推理", "KV缓存", "逻辑掩码", "知识蒸馏"]

原文摘要

查看英文原文摘要

Coupling a property-graph database to an external language-model server imposes a three-part socket tax: serialization overhead dwarfing microsecond graph reads, repeated prefill of verbose schemas, and blind decoding divorced from the live catalog and multi-version concurrency control (MVCC) engine. We present Shoonya, from-scratch commercially clean (0.0% non-commercial or share-alike data) tri-modal (Python, Rust, OpenCypher) small language models (16.8M to 1.07B parameters) co-designed with shoonya-infer, a zero-dependency pure-Rust runtime embedded inside the samyama-graph-enterprise address space. Direct GraphStore references unlock three database-native primitives: (1) an epoch-invalidated SchemaPrefixCache over a copy-on-write PagedKvArena accelerating warm CPU time-to-first-token by 4.91x--13.68x with O(1) DDL invalidation; (2) a 36 us columnar catalog and source-span logit mask enforcing valid ontology identifiers and verbatim spans; and (3) a sub-65 us read-only MVCC gate serving Tier-0 queries inside 389.8 MiB INT8 RSS (59.8--67.9 tok/s) with 0.0% hallucination leak. Rank-factorized tied embeddings (-74.5% vocabulary weights), atomic indentation tokens (0/421 indentation errors), 4:1 grouped-query attention with 2:1 cross-layer KV sharing (-93.75% INT8 KV memory), Warmup-Stable-Decay training, KnOTS SVD merging, Step-GRPO, and Rust Jacobi SVD governance keep 100% of layers heavy-tailed ($α\in [1.88, 2.20]$). Finally, we synthesize nine lessons across v0.1--v1.0, resolving a Reverse-Token-Density Distillation Trap via teacher scaling and zero-VRAM Verifier-Advantage-Gated Knowledge Distillation (AdvKD), recovering +13.61 MBPP points (33.07%) while reaching 100% validity on enrichment, grounded extraction, and tool planning.