NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

From Ambiguity to Explicitness: NLP-Assisted 5G Specification Abstraction for Formal Analysis

Ying Wang, Shiyu Yuan, Jingda Yang, Sudhanshu Arya, Carlo Lipizzi, Ying Wang 0113Cloudnet 2023

TL;DR

This paper introduces a novel NLP-assisted approach to automatically extract formal properties and identifiers from 5G wireless communication protocol specifications, bridging the gap between ambiguous natural language and the strict requirements of formal analysis. By leveraging transformer-based language models and a hybrid training strategy, the method aims to streamline security assessments and reduce the manual effort traditionally required.

What Problem Does This Paper Address?

Formal analysis is crucial for ensuring the security and reliability of complex systems like 5G wireless communication protocols. However, traditional methods rely heavily on manual abstraction of protocol specifications, which is time-consuming and prone to errors. Furthermore, protocol specifications are often written in natural language, which is inherently ambiguous and difficult to translate directly into the explicit, unambiguous format required for formal verification. This ambiguity poses a significant challenge for researchers and industry professionals trying to identify logical vulnerabilities and ensure system robustness. Existing NLP-based approaches for vulnerability detection often rely on random inputs, potentially missing vulnerabilities that require specific sequences of actions. This paper aims to address this gap by proposing an automated method to extract formal properties and identifiers from natural language specifications, making formal analysis more efficient and accessible.

Methods

The proposed approach utilizes a two-step pipeline:

  1. Information Extraction:
    • Structured Data: For tables within the protocol documents, the Tabula tool is used to extract dataframes. A hierarchical filtering process, involving general stopword removal and domain-specific term filtering (provided by domain experts), is applied to extract relevant terminologies.
  2. Unstructured Data: Stanford CoreNLP is employed to extract source-relation-target (SRT) triples from the text. These triples are then filtered using the domain-specific terminology list to retain only relevant in-domain terms. The source and target of the SRT triples are considered as potential identifiers, and the relation as a formal property.
  3. Formal Analysis (Model Training):
    • Dataset Construction: The extracted SRT triples and their corresponding sentences are used to construct an annotation dataset. The source is labeled as 'identifier0', the target as 'identifier1', and the relation as the 'formal property'.
  4. Model Architecture: A transformer-based Masked Language Model (MLM), specifically BERT ('bert-base-cased'), is used as the backbone. This choice is motivated by BERT's bidirectional understanding, which is crucial for capturing context from both left and right of a word.
  5. Training Strategies: Three training strategies are proposed to examine the dependency of formal properties on identifiers and context:
  6. Disjoint Model: Identifiers and formal properties are trained separately.
  7. Joint1 Model: Identifiers are extracted first, and their logits are used as input to predict formal properties, without direct use of sentence context.
  8. Joint2 Model (Proposed): A hybrid joint training model where identifiers are extracted, and then the concatenated hidden state of the sentence and identifier logits are used to predict formal properties. This model hypothesizes that considering both identifier information and context will yield the most representative results.

Datasets

  • Source Document: The primary source document used for analysis is the '5G NR Radio Resource Control (RRC) Protocol specification' [8], a 1197-page document.
  • Annotation Dataset: A custom annotation dataset was constructed from the extracted SRT triples and sentences from the 5G RRC protocol specification. This dataset contains approximately 1400 training samples.

Key Insights and Ideas

  • Bridging Ambiguity: The core idea is to use NLP to translate the inherent ambiguity of natural language protocol specifications into the explicit format required for formal analysis, thereby automating a previously manual and error-prone process.
  • Hybrid Approach: Combining traditional information extraction techniques (like Tabula and CoreNLP) with modern transformer-based language models (BERT) provides a robust framework for extracting both identifiers and their associated formal properties.
  • Context Matters for Formal Properties: The Joint2 model, which explicitly incorporates sentence context alongside identifier information for formal property prediction, demonstrates superior performance compared to models that do not consider context. This highlights that the meaning and implications of identifiers can change based on their surrounding text.
  • Identifier Dependency: The paper suggests that incorrect formal property predictions can stem from incorrect identifier predictions, indicating a strong dependency between these two elements.

Key Results

  • Identifier Extraction Accuracy: The optimal model achieved an accuracy of 39% for identifier extraction.
  • Formal Property Prediction Accuracy: The optimal model achieved an accuracy of 42% for formal property prediction.
  • Model Performance: The Joint2 model, which considers both identifier and sentence context, generally outperformed the Disjoint and Joint1 models in terms of formal property prediction accuracy.
  • Overfitting: The paper notes an overfitting problem, particularly in the Disjoint and Joint1 models, which limits the performance improvement for formal property prediction.

Limitations and Future Work

  • Dataset Size: The authors acknowledge that the dataset size (around 1400 training samples) is relatively small and may be a limiting factor for achieving higher performance.
  • Unrestricted Identifiers/Properties: The current study uses domain-specific terminologies as identifiers and does not strictly define them, which is acceptable for a proof-of-concept but could be refined with a more fine-grained dataset.
  • Future Work:
    • Dataset Expansion: Constructing a larger and more fine-grained dataset is a key priority.
  • Model Refinement: Further research will focus on refining the model architecture, particularly the joint approach, to improve the accuracy of both identifier extraction and formal property prediction.
  • Addressing Incorrect Predictions: Future work will explore masking non-identifier tokens during back-propagation to provide more guided loss on identifiers and potentially improve formal property prediction.
  • Balancing Influence: Investigating how to optimally balance the influence of sentence context and identifier information on formal property prediction is also a future direction.

Summary updated

BibTeX
@inproceedings{wang2023from,
  author = {Ying Wang and Shiyu Yuan and Jingda Yang and Sudhanshu Arya and Carlo Lipizzi and Ying Wang},
  title = {{From Ambiguity to Explicitness: NLP-Assisted 5G Specification Abstraction for Formal Analysis}},
  booktitle = {Cloudnet},
  year = {2023},
  doi = {10.1109/cloudnet59005.2023.10490075},
}
Figure