PreConfig: A Pretrained Model for Automating Network Configuration

Fuliang Li, Haozhi Lang, Jiajie Zhang, Jiaxing Shen, Xingwei WangarXiv 2024 · DOI

Abstract

PreConfig is a specialized, pretrained language model designed to unify and automate three critical network tasks: configuration generation, multi-vendor translation, and semantic analysis. By framing these tasks as "text-to-text" problems and training on a custom-mined network corpus, PreConfig significantly outperforms general-purpose models like GPT-4 in producing syntactically correct and semantically sound network configurations.

Introduction

Network Configuration Automation (NCA) is the backbone of modern data centers, yet it remains surprisingly manual. Current tools are often "single-purpose" silos: one tool synthesizes configurations, another translates between vendors (e.g., Cisco to Juniper), and a third verifies them. These tools rely on rigid, expert-crafted rules that are difficult to scale and maintain as protocols evolve.

While Large Language Models (LLMs) like GPT-4 show promise in coding, they often stumble in the niche world of networking. They lack "domain sensitivity," frequently hallucinating commands or confusing similar-looking but functionally different protocols. The authors identify a massive gap: there is a scarcity of high-quality, supervised training data for network-specific tasks, and general models simply haven't "read" enough router manuals to be reliable.

Methods

The authors propose PreConfig, which moves away from rigid rules toward a flexible, unified transformer-based architecture. Their approach follows a two-stage pipeline:

  1. Task-Adaptive Pretraining: Instead of starting from scratch, they took PLBART (a model already proficient in programming languages) and performed "continued pretraining." They fed it a specialized corpus of network data to sensitize the model to the specific "dialects" of network vendors.
  2. Multi-task Fine-tuning via "ConfigExtract": To solve the data scarcity problem, they built an intelligent agent called ConfigExtract. This agent uses an LLM to "mine" and generate training examples. Crucially, these examples are validated using deterministic network analysis tools like Batfish and Campion. If the tool finds an error, the agent iterates until the data is perfect. This creates a high-quality, verified dataset for fine-tuning.
The unified text-to-text framework of PreConfig for generation, translation, and analysis.

By framing every task—whether it's "Intent → Config" (Generation) or "Cisco → Juniper" (Translation)—as a text-to-text transformation, they can train a single model to handle the entire lifecycle of a network configuration.

Comparison of Cisco and Juniper configuration fragments for the same network intent, illustrating the translation task.

Datasets

The researchers collected a massive 7GB raw corpus from vendor manuals and community forums. From this, they extracted:

  • Pretraining Data: 100MB of cleaned configuration snippets and related natural language (Cisco, Juniper, and English).
  • Supervised Task Data:
    • Generation/Analysis: 4,000 training pairs (Natural Language ↔ Cisco).
  • Translation: 2,400 pairs (Juniper ↔ Cisco).
  • Benchmarks: They used newly introduced benchmarks for configuration understanding and generation, where they compared PreConfig against GPT-3.5 and GPT-4.

Key Results

PreConfig demonstrated a clear lead over general-purpose models:

  • Configuration Generation: PreConfig achieved a BLEU score of 82.25, crushing GPT-4’s 57.82. More importantly, it reached an Exact Match (EM) score of 40.0, indicating it can generate perfect, ready-to-deploy code far more often than generic models.
  • Translation: It successfully mapped complex logic between Cisco and Juniper with a 70.84 BLEU score, proving it understands the semantic equivalence between different vendor syntaxes.
  • Robustness: Qualitative examples show that while ChatGPT often makes "obvious" syntax errors (like misplaced keywords or incorrect IP formatting), PreConfig avoids these by adhering to the strict linguistic patterns it learned during its specialized pretraining.

Conclusion and Future Work

PreConfig proves that treating network configurations as a language allows transformer architectures to handle complex logic across vendors. While it excels at generation and translation, future work is needed to improve natural language flexibility in analysis tasks, where Exact Match scores remain low (10.0). Expanding the model to cover more niche protocols and integrating real-time operator feedback are the next steps toward fully autonomous network configuration.

Summary updated

BibTeX
@misc{li2024preconfig,
  author = {Fuliang Li and Haozhi Lang and Jiajie Zhang and Jiaxing Shen and Xingwei Wang},
  title = {{PreConfig: A Pretrained Model for Automating Network Configuration}},
  year = {2024},
  eprint = {2403.09369},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.09369},
}
Figure