Abstract
Uncrewed aerial vehicles (UAVs) are increasingly deployed for autonomous inspection and sensor data collection in large-scale infrastructure monitoring applications, such as pipeline monitoring, where timely anomaly detection is critical. Jointly optimizing data-collection schedules and flight velocities is a critical challenge, as inefficiencies can increase packet loss and inspection latency. While online deep reinforcement learning (DRL) is a widely investigated approach, it suffers from low sample efficiency, substantial training requirements, and simulation-to-reality gaps in time-sensitive scenarios. Large language models (LLMs) offer a promising alternative through in-context learning (ICL); however, their substantial input requirements can introduce considerable computational and communication overhead. To address this, we propose Attention-Based In-Context Learning for Velocity Control and Data Collection Scheduling (AIC-VDS), a joint optimization framework designed to minimize packet loss under partial and potentially outdated local network-state information. AIC-VDS utilizes an attention module to process real-time network-state data, including sensor battery levels, sensor queue lengths, communication channel conditions, UAV locations, time since the previous sensor visit, and sensor urgency scores. This module extracts task-relevant features to reduce input overhead before querying the LLM. The LLM leverages these compressed natural-language prompts to generate adaptive data-collection schedules and velocity-control decisions for UAV execution. Simulation results show that the attention-based representation reduces the average prompt length by 50\%, while AIC-VDS rapidly stabilizes packet loss in the considered scenario.