Skip to content
 
 

Repository files navigation

LLM-Enhanced Deep Reinforcement Learning for Task Offloading in Collaborative Edge Computing

Abstract

Collaborative edge computing leverages geo-distributed edge nodes to execute tasks, necessitating dynamic task offloading decisions to maintain low latency and high reliability, especially under unpredictable node failures. Although deep reinforcement learning (DRL) and large language models (LLMs) have shown promise for task offloading, DRL often suffers from high sample inefficiency and local optima, whereas LLMs struggle with real-time decision-making. To address these limitations, we propose LeDRL, a hybrid decision framework that couples a lightweight LLM with self-attention-enhanced DRL for real-time task offloading. LeDRL constructs structured, context-aware prompts capturing node status, task semantics, and link dynamics to derive high-level strategy priors. These are selectively processed by a self-attention-based alignment module for context-aware policy optimization. A reflective evaluator distills semantic feedback from past trajectories to guide future prompts, enabling more informative and temporally generalizable LLM queries. Extensive experiments show that LeDRL outperforms baselines in task success rate, convergence speed, and real-time responsiveness across diverse network scales, achieving over 17% improvement in success rate. Furthermore, we deploy LeDRL on Jetson-based edge devices using our prototype system CoEdgeSys, demonstrating its robustness and feasibility under resource constraints. Our code is available at: https://anonymous.4open.science/r/LeDRL-854B/.

Installation

  1. Create a new conda environment with:

    conda create -n ledrl python=3.10
    conda activate ledrl
    
  2. Install pytorch and CUDA:

    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
    
  3. Install the packages in the requirements.txt:

    pip install -r requirements.txt
    

Getting Started

Navigate to the LeDRL directory and execute the command within a tmux session:

python main.py --name="ledrl" --algo_type="ledrl" --edge_node_num=10 --t_max=40000

Results of LeDRL

The obtained results are saved at the following path:

./results

including logs, tensorboard, models.

Viewing Training Results with TensorBoard

Run the following command in the root directory of the current project (~/codes/LeDRL)

tensorboard --logdir=./results/tensorboard 

About

The souce code of "LLM-Enhanced Deep Reinforcement Learning for Task Offloading in Collaborative Edge Computing" (accepted by SECON 2026)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages