Structure-Aware NL-to-SQL for SFC Provisioning via AST-Masking Empowered Language Models
Xinyu Zhu, Parisa Fard Moshiri, Poonam Lohan, Burak Kantarci, Emil Janulewicz
TL;DR
This work tackles the challenge of reliably translating natural language into executable SQL for Service Function Chain provisioning in SDN/NFV environments, where syntactic errors can disrupt decision loops. It introduces AST-Masking, a structure-aware fine-tuning method that uses SQL Abstract Syntax Trees to assign token weights and guide learning, enabling syntactically valid NL-to-SQL generation without increasing inference overhead. Evaluated on a domain-specific NL-SQL dataset across Qwen, FLAN-T5, and Gemma, AST-Masking yields large gains in Execution Accuracy and the Valid Efficiency Score, with FLAN-T5 approaching near-perfect accuracy and Gemma achieving substantial absolute improvements. The approach reinforces interpretability and responsiveness in DRL-based SFC orchestration, offering practical benefits for real-time network management and paving the way for adaptive weighting across SQL dialects in future work.
Abstract
Effective Service Function Chain (SFC) provisioning requires precise orchestration in dynamic and latency-sensitive networks. Reinforcement Learning (RL) improves adaptability but often ignores structured domain knowledge, which limits generalization and interpretability. Large Language Models (LLMs) address this gap by translating natural language (NL) specifications into executable Structured Query Language (SQL) commands for specification-driven SFC management. Conventional fine-tuning, however, can cause syntactic inconsistencies and produce inefficient queries. To overcome this, we introduce Abstract Syntax Tree (AST)-Masking, a structure-aware fine-tuning method that uses SQL ASTs to assign weights to key components and enforce syntax-aware learning without adding inference overhead. Experiments show that AST-Masking significantly improves SQL generation accuracy across multiple language models. FLAN-T5 reaches an Execution Accuracy (EA) of 99.6%, while Gemma achieves the largest absolute gain from 7.5% to 72.0%. These results confirm the effectiveness of structure-aware fine-tuning in ensuring syntactically correct and efficient SQL generation for interpretable SFC orchestration.
