Multi-agent large language model (LLM) systems offer strong capabilities for complex reasoning and decision-making, yet coordination across agents introduces error propagation, security risks, and inefficient use of resources. Existing methods often rely on heuristic, static strategies and lack a principled mechanism for balancing performance, security, and computational cost. This paper formulates multi-agent LLM coordination as a constrained optimization problem and proposes a security-aware method for adaptive agent selection. The method integrates trust modeling, risk-aware evaluation, and collective intelligence within a unified optimization objective. To solve the problem efficiently, we use a swarm-intelligence strategy inspired by Gorilla Troops Optimization (GTO), enabling adaptive coordination under varying threat conditions. Controlled experiments across 500 independent runs demonstrate the effectiveness of the proposed method. The system achieves a stable average performance score of 0.5281, with high consensus (0.8764), controlled risk (0.3000), and compact agent subsets averaging 4.04 selected agents. The optimization process converges efficiently, with an average runtime of 24.09 seconds per run and low score variability (standard deviation = 0.0173). Robustness analysis indicates graceful degradation under perturbations, with performance drops limited to 2.5% under agent removal and 5.3% under consensus disruption. These results show that effective multi-agent coordination can be achieved through structured optimization that jointly manages performance, security, and efficiency. The proposed method provides a practical security-aware solution for coordinating multi-agent LLM systems in complex adversarial settings.
翻译:多智能体大语言模型(LLM)系统在复杂推理与决策方面具有强大能力,但智能体间的协调会引发错误传播、安全风险及资源低效利用等问题。现有方法多依赖启发式静态策略,缺乏平衡性能、安全性与计算代价的原则性机制。本文将多智能体LLM协调问题建模为约束优化问题,提出一种感知安全的自适应智能体选择方法。该方法将信任建模、风险评估与集体智慧整合到统一优化目标中。为高效求解该问题,我们采用受猩猩部队优化(GTO)启发的群体智能策略,实现变威胁条件下的自适应协调。基于500次独立运行的对照实验证明了该方法的有效性。系统在稳定状态下平均性能得分为0.5281,具有高共识度(0.8764)、可控风险(0.3000),且智能体子集紧凑(平均选择4.04个智能体)。优化过程收敛高效,单次运行平均耗时24.09秒,得分变异度低(标准差=0.0173)。鲁棒性分析表明,系统在扰动下性能平缓退化:智能体移除时性能损失不超过2.5%,共识破坏时不超过5.3%。结果表明,通过联合管理性能、安全性与效率的结构化优化,可实现有效的多智能体协调。该方法为复杂对抗环境下多智能体LLM系统的协调提供了实用化的安全感知解决方案。