arXiv:2605.25835cs.LGcs.AI2026-05

用合成数据训练小模型生成规范K8s配置,效果优于单纯堆数据。

Context-Instrumental Data Distillation for Kubernetes Manifest Generation: Method and Experimental Evaluation

  • 通过合成与反向指令生成数据,只保留经验证的合规样本
  • 在200个测试样本上达成91.5%的完全通过率,关键依赖格式严格约束
  • 适合资源有限环境下快速部署K8s配置生成工具的开发者

本文研究参数量不超过40亿的小型语言模型(SLM)在领域特定语言(DSL)中的专业化能力,以Kubernetes清单文件为研究对象。提出一种上下文驱动的数据蒸馏方法:数据源通过合成生成或从真实YAML文件逆向生成,仅当通过外部校验且符合领域上下文时才进入训练。该方法本质等价于对经仪器验证样本的监督微调。实验在资源受限条件下开展:使用DeepSeek-V4 Flash API生成数据,以Qwen2.5-Coder-1.5B-Instruct模型在CPU上通过LoRA微调。基于K8s-Distill-Pilot数据集(训练集1200、验证集100、测试集200),采用更严格的提示格式和max_new_tokens=768时,实现full-pass@1 = 91.5%(183/200)。核心发现表明,在Kubernetes YAML生成中,结果质量更依赖输出格式的严格性,而非训练样本数量的增加。

原文摘要 · Abstract (English)

This paper examines the specialization of Small Language Models (SLMs) with up to 4 billion parameters for generating artifacts in domain-specific languages (DSL). Kubernetes manifests are chosen as the target domain. We propose the context-instrumental data distillation method: the source corpus is formed through synthetic generation and, in an extended scheme, through reverse instruction generation from real Kubernetes YAML files, with pairs included in training only upon passing external validators and matching the domain context model. Unlike classical KL-divergence knowledge distillation, the baseline implementation reduces to supervised fine-tuning on instrumentally verified examples. The experimental section presents a pilot implementation under resource-constrained conditions: the DeepSeek-V4 Flash API serves as the teacher for synthetic generation, while Qwen2.5-Coder-1.5B-Instruct is fine-tuned via LoRA on CPU. On the K8s-Distill-Pilot corpus (train_1200, validation_100, test_200), we achieved full-pass@1 = 91.5% (183/200) with a stricter prompt formulation and max_new_tokens=768. The key empirical finding is that for Kubernetes YAML, result quality in the pilot depended more on strict output format requirements than on simply increasing the number of training examples.

K8s生成小模型数据蒸馏代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。