动态调整提示词,让大模型自动适配不同电子元件的参数提取需求。
DynaContext: Self-Improving Dynamic Contextualization of Optimized Prompts for Heterogeneous Parameter Extraction

- 在推理时根据上下文动态组合提示,结合内部/外部证据路径。
- 相比静态提示,字段级F1提升至71.0%,最高达98.6%准确率。
- 适合需要高精度、多类型参数提取的工业场景,如电子元件数据清洗。
自动化提示与技能优化通常生成单一静态指令,在推理中重复使用,无法应对输入间上下文、约束和证据状态的变化。例如,从电子元件描述中提取参数时,电阻器、电容器、晶体管和连接器所需字段、单位约束及示例各不相同,且每条输入的证据状态各异。我们提出DynaContext框架,融合离线优化的提取核心(基于GEPA或SkillOpt)与推理时的上下文自适应及验证门控的自我改进机制。DynaContext通过内部、外部或回退证据路径路由每项任务,并从核心、模式、证据、未解字段和已验证示例中构建专属提示。通过确定性验证与LLM判官过滤输出,不确定结果交由人工审查,仅人工确认的修正进入示例记忆。在单类别基准上,基础提示平均准确率从86.6%提升至96.9%(独立SkillOpt)和98.6%(最优DynaContext配置)。在850个异构真实参数事实上,字段级F1从无优化无示例的51.8%升至动态示例单独使用时的59.2%,优化核心单独使用时66.9%,两者结合达71.0%。固定模型下,完整配置比部署的静态提示流水线平均提升17.3 F1点。
原文摘要 · Abstract (English)
Automated prompt and skill optimization typically produces a single static instruction that is reused across inference instances until the next optimization cycle. However, this approach cannot adapt when the required context, constraints, and evidence vary from one instance to another. For instance, parameter extraction from electronic component descriptions breaks this assumption: resistors, capacitors, transistors, and connectors require different fields, unit constraints, and demonstrations, and each input provides a different evidence state. We introduce DynaContext, a framework that combines an offline-optimized extraction core, learned with GEPA or SkillOpt, with inference-time contextual adaptation and validation-gated self-improvement. DynaContext routes each item through internal, external, or fallback evidence paths and composes an item-specific prompt from the core, schema, evidence, unresolved fields, and validated demonstrations. Deterministic validation and an LLM judge gate every output, uncertain cases go to human review, and only human-verified corrections enter the demonstration memory. On a single-category benchmark, average accuracy increases from 86.6% for the base prompt to 96.9% for standalone SkillOpt and 98.6% for the best DynaContext configuration. Across 850 heterogeneous gold parameter facts, average field-level F1 increases from 51.8% for an unoptimized, demonstration-free control to 59.2% with dynamic demonstrations alone, 66.9% with the optimized core alone, and 71.0% with both. Holding the model fixed, the full configuration outperforms the deployed static-prompting pipeline by 17.3 F1 points on average.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。