让大模型高效处理海量机器数据,减少90% token消耗
HYVE: Hybrid Views for LLM Context Engineering over Machine Data
- 用混合列式/行式视图重构机器数据,只传关键信息给大模型
- 在真实场景中降低50%-90%的token使用,生成准确率提升132%
- 适合需要分析日志、指标等结构化数据的运维与故障排查场景
机器数据是现代计算系统可观测性和诊断的核心,包括日志、指标、遥测追踪和配置快照。当这类数据输入大语言模型(LLMs)时,通常包含自然语言与结构化内容(如JSON或Python/AST字面量)。然而,现有模型对这类长且嵌套深、重复结构多的数据仍表现脆弱。本文提出HYVE(HYbrid ViEw),一种基于数据库管理思想的上下文工程框架,用于处理含大量机器数据的输入。通过请求级数据存储与模式信息增强,在预处理阶段,检测重复结构并将其材料化,转化为混合列式与行式视图,仅向模型暴露最相关表示;在后处理阶段,直接返回输出、查询数据存储恢复缺失信息,或进行有限的额外模型调用以实现基于SQL的语义合成。在涵盖知识问答、图表生成、异常检测与多步网络排障的多种真实工作负载上评估显示,HYVE将token使用量降低50%-90%,同时保持或提升输出质量。在结构化生成任务中,图表生成准确率最高提升132%,延迟降低83%。总体而言,该框架为以大规模机器数据为主导的提示提供了近似无限上下文窗口的实用方案。
原文摘要 · Abstract (English)
Machine data is central to observability and diagnosis in modern computing systems, appearing in logs, metrics, telemetry traces, and configuration snapshots. When provided to large language models (LLMs), this data typically arrives as a mixture of natural language and structured payloads such as JSON or Python/AST literals. Yet LLMs remain brittle on such inputs, particularly when they are long, deeply nested, and dominated by repetitive structure. We present HYVE (HYbrid ViEw), a framework for LLM context engineering for inputs containing large machine-data payloads, inspired by database management principles. HYVE surrounds model invocation with coordinated preprocessing and postprocessing, centered on a request-scoped datastore augmented with schema information. During preprocessing, HYVE detects repetitive structure in raw inputs, materializes it in the datastore, transforms it into hybrid columnar and row-oriented views, and selectively exposes only the most relevant representation to the LLM. During postprocessing, HYVE either returns the model output directly, queries the datastore to recover omitted information, or performs a bounded additional LLM call for SQL-augmented semantic synthesis. We evaluate HYVE on diverse real-world workloads spanning knowledge QA, chart generation, anomaly detection, and multi-step network troubleshooting. Across these benchmarks, HYVE reduces token usage by 50-90% while maintaining or improving output quality. On structured generation tasks, it improves chart-generation accuracy by up to 132% and reduces latency by up to 83%. Overall, HYVE offers a practical approximation to an effectively unbounded context window for prompts dominated by large machine-data payloads.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。