5G Network Automation Using Local Large Language Models and Retrieval-Augmented Generation

Ahmadreza Majlesara 1 , Ali Majlesi 1 , Ali Mamaghani 1 , Alireza Shokrani 1 , Babak Hossein Khalaj 1 · 2025

Read 5G Network Automation Using Local Large Language Models and Retrieval-Augmented Generation by Ahmadreza Majlesara 1 , Ali Majlesi 1 , Ali Mamaghani 1 , Alireza Shokrani 1 , Babak Hossein Khalaj 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-21084.txt.

Introduction

Ahmadreza Majlesara and colleagues demonstrate in 2025 a privacy-first way to run a 5G network with plain-language commands. Cloud language models are powerful but would expose sensitive network data, so the team runs everything locally. Their system pairs Llama 3, an 8-billion-parameter model squeezed into 4-bit form, with retrieval-augmented generation, which fetches relevant examples from a database before the model answers.

The whole setup needs under 6 gigabytes of video memory, so it runs on laptops with a common NVIDIA 3060 graphics card. A request flows through two steps. First the model classifies the command into one of 11 classes, such as test, create, or remove, guided by the 8 most similar retrieved examples. Then it generates the exact command in the right syntax. The authors show the approach lets users without deep networking or programming experience build and configure private 5G networks, with no data ever leaving the machine.

Catalog record

CREATORAhmadreza Majlesara 1 , Ali Majlesi 1 , Ali Mamaghani 1 , Alireza Shokrani 1 , Babak Hossein Khalaj 1
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE11 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-21084

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

5G Network Automation Using Local Large Language Models and Retrieval-Augmented Generation Ahmadreza Majlesara 1 , Ali Majlesi 1 , Ali Mamaghani 1 , Alireza Shokrani 1 , Babak Hossein Khalaj 1 Abstract This demonstration showcases the integration of a lightweight, locally deployed Large Language Model (LLaMA-3 8b Q-4b) empowered by retrieval-augmented generation (RAG) to automate 5G network management, with a strong emphasis on privacy. By running the LLM on local or edge devices, we eliminate the need for external APIs, ensuring that sensitive data remains secure and is not transmitted over the internet. Although lightweight models may not match the performance of more complex models like GPT-4, we enhance their efficiency and accuracy through RAG. RAG retrieves relevant information from a comprehensive database, enabling the LLM to generate more precise and effective network configurations based on natural language user input. This approach not only improves the accuracy of the generated configurations but also simplifies the process of creating and configuring private networks, making it accessible to users without extensive networking or programming experience. The objective of this demonstration is to highlight the potential of combining local LLMs and RAG to deliver secure, efficient, and adaptable 5G network solutions, paving the way for a future where 5G networks are both privacy-conscious and versatile across diverse user profiles. I. Introduction The concept of private networks has come into importance with the global shift in mobile technology from 4G to 5G and onwards. Private networks provide bespoke connectivity options, but setting these kind of networks up often requires broad knowledge in networking and software development. At the same time, artificial intelligence developments, particularly large language models, are also revolutionizing communication infrastructures by offering new ways to automate complex technical tasks easily. Thus, the idea of using LLMs to realize automation in configuration and management tasks in private networks has been discussed and demonstrated in recent years. The issue has been addressed and elaborated on in the work titled LLM for 5G: Network Management. [ 1 ] This automation, although, comes with some overhead in implementation. the main challenges investigated in this demo are privacy and cost efficiency. Generally, LLMs deployed on the cloud, such as ChatGPT, need API access and the transmission of data across the internet, raising privacy issues. Besides, all these cloud solutions are pretty pricey because they charge for API usage. This was, however, brought to light in recent times with the advent of lightweight and efficient LLMs that could run on the local machine.The models, apart from their core functionality, have the dual advantage of reduced operational costs -that can be done by accessible GPUs- and heightened privacy by not having to send sensitive data over the internet to external servers.Although local models do not undergo pre-training for advanced tasks and demonstrate lower accuracy compared to more sophisticated models such as GPT-3.5, the capacity to implement these models within local settings undoubtedly represents a significant advancement in improving safety and effectiveness in the management of networks. The introduction of Retrieval-Augmented Generation (RAG) has considerably improved AI-driven communication systems by allowing large language models (LLMs) to retrieve pertinent information as required, thereby generating outputs with enhanced precision. The capacity of RAG to utilize current databases minimizes the necessity for ongoing fine-tuning and results in reduced expenses. Our new system introduces several key innovations: • Novel Use of Local LLMs: We leverage locally deployed LLMs, ensuring that all data processing occurs within secure, isolated environments, thereby enhancing privacy and security. Furthermore, this approach reduces the cost of operation. • Integration of RAG: By incorporating a general-purpose RAG model, our system allows for real-time retrieval of relevant data, enabling on-the-fly adaptation to new requirements and scenarios. The adaptive database architecture facilitates seamless updates, making the system both flexible and efficient. Fig. 1: this illustration shows our system overview and flow of data. user instruction in natural language is given to 2 parallel pipelines to get system files and retrieve similar samples from databases and give these to the LLM to generate the commands that user requested. These contributions represent a significant advancement in the automation of private 5G network creation, making the process more accessible, cost-efficient, and secure. By integrating state-of-the-art AI technologies in a privacy-conscious manner, our work paves the way for broader adoption of private networks in future communication infrastructures. II. Methodology The LLM model generates commands from a user’s natural language description in two steps: 1. Command Classification 2. Command Generation In the first step, LLM detects the class of the command based on the user’s prompt. In the second step, a description of the specified class and samples retrieved from a corpus are provided to LLM to generate the command. These two steps will be discussed in the following subsections. II.A. Step 1: Command Classification In the first step, the LLM identifies the class of the command, which can be one of 11 possible classes, such as ”test,” ”create,” or ”remove.” To assist with this classification, first a sample retriever finds the 8 most similar examples from the dataset. These examples, along with their class labels, are appended to the end of the prompt (see Fig. 2 ). The LLM then uses this prompt to determine the appropriate command class. The retrieved examples ensure that the LLM generates the command in the correct syntax [ 2 ] . For the retrieval process, we used BAAI/bge-small-en-v1.5 [ 3 ] as the embedding model and the Llama Index retriever [ 4 ] . II.B. Step 2: Command Generation Once the command class is determined, the LLM generates the specific command in the second step. The system prompt associated with the selected command class is used to form the prompt for this step. This system prompt includes a description of the command’s task, its options, and any relevant flags. The retriever then retrieves similar examples from the command corpus and appends them to the prompt. The LLM uses this information to generate the command. After the LLM generates the response which include the description and command, it is filtered using regular expressions to extract only the command itself, removing any extra explanations or details. III. Model Implementation We used a 4-bit quantized version of Llama 3 with 8 billion parameters as the LLM. This model was implemented using Ollama [ 5 ] , a Python library that allows LLMs to be run locally. Remarkably, this implementation requires less than 6GB of vRAM, making it feasible to run on laptops equipped with NVIDIA 3060 GPUs, which are common today. System Prompt: You are a classifier to classify the input command into the categories below: 1. user: add a new user from its IMSI number to the network. 2. list: List all of the users, gnode-bs, or nodes. … ———————————— Instruct: Could you please give me the list of active users Samples: 1. Input: Could you kindly offer me a the list of active users since 2024/08/10 Output: list 2. Input: I want list of active users Output: list … ———————————— Answer: list Fig. 2: An example of the classifier prompt System Prompt: You are assistant to … The input is a message in which someone is trying to get list of users,

Read the complete text