A reinforcement learning decision-making method with multi-granularity semantic prompts from large language models
摘要
In high-dimensional real-time strategy (RTS) environments with sparse rewards, PPO-style reinforcement learning can exhibit high training variance and exploration stagnation. Large language models (LLMs) provide semantic priors, yet naïve prompt injection may cause semantic–action mismatch and latency-induced control jitter. We propose PPO-Dynamic, a macro–meso–micro prompting framework that generates hierarchical instructions online and integrates them into PPO through state-aligned fusion. Prompts at all levels are mapped into a shared embedding space via the same encoder–projection pipeline and aligned to policy state features using cross-attention; a probabilistic gating strategy then regulates when semantic guidance should influence action selection to preserve stability. On the StarCraft II CollectMineralShards benchmark, PPO-Dynamic improves per-step collection efficiency (median 0.43 vs 0.28/0.27 minerals/step) and increases exploration coverage (35.87% vs 13.59%/15.93%), with gains that are statistically significant (two-sample Welch’s test,