LLM4AirTrack adapts the
LLM4STP (Large Language Model for Ship Trajectory Prediction) framework from maritime AIS to aviation ADS-B domain. The core insight is that pre-trained LLMs encode powerful sequential pattern recognition that transfers to spatiotemporal trajectory data through lightweight reprogramming — without full fine-tuning.
┌─────────────────────────────────────────────────────────────────┐
│ LLM4AirTrack Framework │
│ │
│ ADS-B Features (9-dim: xyz + direction + polar) │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ RevIN Normalizer │ Instance normalization per feature │
│ └──────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Patch Tokenizer │ Overlapping temporal patches (8×9=72) │
│ └──────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ ┌─────────────────────┐ │
│ │ Patch Embedder │ │ Text Prototype Bank │ │
│ │ (72 → 768) │ │ (256 learned protos) │ │
│ └──────────────────┘ └─────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ Cross-Attention Reprogrammer │ │
│ │ Q=patches, K=V=prototypes (8-head) │ │
│ │ Maps trajectory → LLM text space │ │
│ └──────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Prompt-as-Prefix │ Aviation context prompt prepended │
│ └──────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Frozen GPT-2 │ 124M params frozen, language knowledge │
│ └──────────────────┘ │
│ │ │
│ ├──────────────────┐ │
│ ▼ ▼ │
│ ┌──────────┐ ┌──────────────────┐ │
│ │ Traj Head│ │ Classification │ │
│ │ (xyz) │ │ Head (route/rwy) │ │
│ └──────────┘ └──────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
9-Dimensional Kinematic Features (from
ATSCC ):
Position: (x, y, z) in East-North-Up coordinates
Directional unit vectors: (ux, uy, uz) — velocity direction
Polar components: (r, sin θ, cos θ) — angular position
Patch Tokenization : Overlapping temporal windows (patch_len=8, stride=4) → 14 patches from 60-step context
Cross-Attention Reprogramming (from
Time-LLM ): 256 learned text prototypes serve as a "translation dictionary" between trajectory and language domains
Frozen GPT-2 Backbone : 124M frozen parameters preserve pre-trained language understanding while keeping training efficient
Dual Output Heads :
Trajectory Prediction : Future (x, y, z) positions via Smooth L1 loss
Route Classification : STAR/IAF/Runway procedure via Cross-Entropy loss
1 import torch
2 import json
3 from huggingface_hub import hf_hub_download
4
5 # Download model files
6 config_path = hf_hub_download ( "Jdice27/LLM4AirTrack" , "config.json" )
7 weights_path = hf_hub_download ( "Jdice27/LLM4AirTrack" , "adapter_weights.pt" )
8
9 # You can use the self-contained train_full.py or the modular llm4airtrack package
10 from llm4airtrack . model import LLM4AirTrack
11
12 with open ( config_path ) as f :
13 cfg = json . load ( f )
14
15 model = LLM4AirTrack (
16 llm_name = cfg [ "llm_name" ] ,
17 context_len = cfg [ "context_len" ] ,
18 pred_len = cfg [ "pred_len" ] ,
19 n_classes = cfg [ "n_classes" ] ,
20 n_prototypes = cfg [ "n_prototypes" ] ,
21 patch_len = cfg [ "patch_len" ] ,
22 patch_stride = cfg [ "patch_stride" ] ,
23 )
24 state = torch . load ( weights_path , map_location = "cpu" )
25 model . load_state_dict ( state , strict = False )
26 model . eval ( )
27
28 # Input: 60 timesteps × 9 kinematic features
29 # Features: [x, y, z, ux, uy, uz, r, sin_θ, cos_θ] in ENU coordinates
30 context = torch . randn ( 1 , 60 , 9 ) # Replace with real data
31 outputs = model ( context , task = "both" )
32
33 future_xyz = outputs [ "pred_trajectory" ] # (1, 30, 3) — future ENU positions
34 route_probs = outputs [ "pred_class" ] . softmax ( - 1 ) # (1, 39) — route probabilities
1 from llm4airtrack . data import download_atfm_dataset , load_atfm_raw , compute_kinematic_features
2
3 # Download and load ATFMTraj
4 download_atfm_dataset ( "RKSIa" , cache_dir = "./data" )
5 data , labels = load_atfm_raw ( "RKSIa" , "TEST" , "./data" )
6
7 # Get kinematic features for a single trajectory
8 traj = data [ 0 ] # (T_max, 3) ENU coordinates
9 valid = ~ np . isnan ( traj [ : , 0 ] )
10 features = compute_kinematic_features ( traj [ valid ] ) # (T, 9)
1 @misc{llm4airtrack2026,
2 title={LLM4AirTrack: LLM-Driven Multi-Feature Fusion for Aircraft Trajectory Prediction},
3 author={Jdice27},
4 year={2026},
5 url={https://huggingface.co/Jdice27/LLM4AirTrack},
6 note={Adapted from LLM4STP for aviation ADS-B domain}
7 }