MARD: A Multi-Agent Framework for Robust Android Malware Detection Xueying Zeng⋆§ , Youquan Xian‡§ , Sihao Liu⋆ , Xudong Mou⋆ ,Yanze Li⋆ , Lei Cui‡ , Bo Li⋆ B ⋆ School of Computer Science and Engineering, Beihang University, Beijing, China
arXiv:2604.25264v1 [cs.CR] 28 Apr 2026
‡ School of Cyberspace Security, Beijing University of Posts and Telecommunications, Beijing, China
Abstract—With the rapid evolution of Android applications, traditional machine learning-based detection models suffer from concept drift. Additionally, they are constrained by shallow features, lacking deep semantic understanding and interpretability of decisions. Although Large Language Models (LLMs) demonstrate remarkable semantic reasoning capabilities, directly processing massive raw code incurs prohibitive token overhead. Moreover, this approach fails to fully unleash the deep logical reasoning potential of LLMs within complex contexts. To address these limitations, we propose MARD, a multi-agent framework for robust Android malware detection. This framework effectively bridges the gap between the semantic understanding of LLMs and traditional static analysis. It treats underlying deterministic analysis engines as on-demand execution tools, while utilizing the LLM to orchestrate the entire decision-making process. By designing an autonomous multi-agent interaction mechanism based on the ReAct paradigm, MARD constructs a highly interpretable evidentiary chain for conviction. Furthermore, we radically reduce the total cost of conducting a deep analysis of a single complex APK to under $0.10. Evaluations demonstrate that, without any domain-specific fine-tuning, MARD achieves an F1 score of 93.46%. It not only outperforms continual learning baselines but also exhibits robustness against concept drift and strong cross-domain generalization capabilities in evaluations spanning up to five years. Index Terms—Malware Detection, Large Language Models, Concept Drift, Autonomous Processing
I. I NTRODUCTION The Android operating system occupies a dominant position in the mobile ecosystem, making it the primary target for global malware attacks and posing a severe security threat to hundreds of millions of users for an extended period [1], [2]. Consequently, both academia and industry are continuously committed to enhancing malware detection capabilities [3]– [8]. Early research primarily relied on extracting static features such as API calls [9]–[11], permissions [12], [13], and function call graphs [14]–[16]. These approaches utilized data-driven methods based on Machine Learning (ML) or Deep Learning (DL) to fit statistical patterns of malicious behavior on largescale training sets. However, with the rapid iteration of the Android ecosystem, the distribution of benign and malicious applications in shallow feature spaces has undergone significant shifts [17]. This causes detection models trained on historical data to face severe concept drift and performance aging issues upon deployment [18]. § Equal contribution. B Corresponding author.
To maintain long-term detection efficacy in dynamically evolving environments, MaMaDroid [19] introduces an API call abstraction mechanism and utilizes Markov chains to model call sequences and capture program behavioral patterns. Subsequently, some research perspectives delved into the semantic level [20]–[22]. These methods effectively capture the invariant core behavioral rules of malware by extracting the semantic features of APIs and mapping newly emerged APIs into existing semantic spaces. Meanwhile, LDCDroid [23], CADE [24], and FeSAD [25] approach the problem from the perspective of data distribution. They address the distribution shifts caused by malware evolution by deeply learning and capturing data drift characteristics. To reduce the retraining costs associated with model adaptation to evolution, Xu et al. [26] and Huang et al. [27] explored automatic incremental update mechanisms based on pseudo-labeling techniques. Furthermore, Chen et al. [28] combined active learning with similarity uncertainty sampling in a continual learning approach. This method effectively overcomes the rapid failure of detection models by precisely selecting high-value new samples for manual annotation and model retraining. Although existing continual learning and active learning strategies alleviate model aging to some extent, traditional deep learning methods still possess inherent limitations. First, their mining of deep semantic information, such as the contextual logic of API calls, permission configurations, and their intentional correlation with real behaviors, remains insufficient. Second, such models typically operate as black boxes, lacking interpretability of decisions, and still rely on continuous data annotation and retraining to maintain performance. In recent years, Large Language Models (LLMs) have made significant progress, and their semantic understanding and reasoning capabilities in complex contexts have improved rapidly [29]. SRDC [30], AppPoet [31], ForeDroid [32], and Yan et al. [33] utilized LLMs to assist traditional classification models in semantic enhancement at the feature dimension. Simultaneously, Zheng et al. [34] combined ML outputs with LLMs for comprehensive reasoning. Furthermore, He et al. [35] and Qian et al. [36] directly fed decompiled function snippets and code fragments into LLMs for adjudication. However, directly feeding massive and verbose raw code features into LLMs incurs tremendous token consumption. This approach easily hits the context window limits, leading to high deployment costs and low efficiency. Additionally, simply reducing LLMs
to advanced feature extractors fails to truly uncover and fully utilize their deep logical reasoning and intent deduction capabilities within complex malware behavior contexts. To bridge the profound gap between the deep semantic reasoning of LLMs (constrained by context windows) and the precise control-flow tracking of static analysis (inherently lacking intent awareness), this paper proposes MARD, a multi-agent framework for robust Android malware detection. Specifically, deterministic underlying static analysis engines (such as Soot and FlowDroid) serve as on-demand execution tools, while the LLM acts as the orchestrating brain. Together, they construct an end-to-end collaborative architecture that autonomously executes macro-level screening, micro-level forensics, and global adjudication. The main contributions of this paper are as follows: • We propose MARD, which deeply integrates the continuously escalating high-order semantic reasoning capabilities of LLMs with underlying static analysis engines. It constructs an Android malware detection framework capable of executing high-dimensional intent reasoning and low-level logical forensics without any domain-specific fine-tuning. • We design a multi-agent autonomous interaction mechanism based on the ReAct paradigm. This mechanism autonomously plans actions for high-risk APIs and dynamically drives the underlying engines to extract definitive control-flow and data-flow slices, realizing an interpretable evidentiary chain for conviction. • By leveraging a heterogeneous model strategy, MARD achieves precise allocation of computational resources, compressing the total end-to-end cost of deeply analyzing a single complex APK to under $0.10. • Extensive empirical evaluations demonstrate that MARD achieves an F1-score of 93.46% on the datasets. It comprehensively outperforms continual learning baseline models reliant on large-scale data training. Furthermore, in long-span tests from 2017 to 2021, the framework exhibits profound resilience against concept drift and robust cross-domain generalization capabilities. The remainder of this paper is structured as follows: Section II introduces the relevant background knowledge and existing challenges. Section III briefly outlines the framework of MARD. Section IV provides the implementation details of the proposed scheme. Section V presents the experimental results and analysis. Finally, Section VI concludes this paper and envisions future work.
applications by quantifying a score for each API. Beyond focusing solely on the critical feature of APIs, the methods in [8], [41]–[43] integrate multiple features to construct sequential representations. These approaches combine these representations with ML or DL techniques, further improving malware classification accuracy. However, both the Android ecosystem and malware itself continuously evolve. This evolution results in feature discrepancies between old and new applications. Consequently, detection models trained on historical data experience a significant decline in performance when encountering novel malware. This problem is known as concept drift or model aging. To maintain long-term detection capabilities, MaMaDroid [19] constructs static methods resilient to API changes. Subsequently, frameworks like SDAC [20], APIGRAPH [21], and AMDASE [22] extract semantic embeddings of APIs. They conduct clustering analysis to capture the invariant essential behavioral patterns of malware at the feature level. This strategy effectively delays model aging. In addition to mining invariant underlying features, another line of research focuses on adapting to changes in data distribution. Yang et al. [24] pioneered the use of contrastive learning to detect and explain concept drift samples in security applications within the latent space. Following this trajectory, FeSAD [25], [44] constructs dedicated drift adaptation layers for ransomware and Android malware. These layers proactively perceive and quantify the distribution shifts caused by evolution. Regarding dynamic model updating, DroidEvolver [26] and LDCDroid [23] utilize pseudo-labels to update or retrain detection models by dynamically identifying data drift in new applications. However, the presence of noise in these pseudo-labels can lead to rapid deterioration of model performance. To address this, Chen et al. [28] introduced a sample selection strategy from active learning. Their work proposes a continual learning mechanism to tackle continuously evolving malware more reliably. Nevertheless, all the aforementioned data-driven paradigms fundamentally remain constrained by the shallow fitting of statistical features. They lack the semantic understanding capability required to grasp the deep business intent and complex code logic of applications. Moreover, frequent model retraining in continual or active learning consumes massive computational resources and incurs high expert annotation costs. Furthermore, the inherent black-box nature of deep learning renders these models incapable of outputting a definitive, code-level evidentiary chain for conviction.
II. R ELATED W ORK A. Learning-based Malware Analysis API calls, as the core static features characterizing the key behaviors of applications, are widely used in Android malware detection systems [37], [38]. AppContext [39] utilizes static analysis to extract the contextual features of sensitive APIs in applications, including their triggering events and related control-flow factors. Yumlembam et al. [40] captured the differences in API usage patterns between benign and malicious
B. LLM-based Malware Analysis Large Language Models, with their exceptional code comprehension and commonsense reasoning capabilities, offer a highly promising technological pathway for addressing cybersecurity challenges [45]. The utilization of LLMs to assist in Android malware analysis can be broadly categorized into two main paradigms: LLM-based feature semantic enhancement and LLM-based direct reasoning analysis. The specific architectural differences are illustrated in Fig. 1.
Training Required APK
Decompile
File LLM (Auxiliary feature enhancement All API, or knowledge supplementation) Permission, etc Feature semantic enhancement based on LLM High Token Consumption
APK
Decompile Primitive function, All API
LLM (Summarize thousands of original functional fragments or APIs)
III. MARD OVERVIEW
Direct reasoning analysis based on LLM Information analysis APK
Decompile
Autonomous LLM Planning
Execution and feedback analysis Capability enhancement
system with exorbitant model retraining overheads. Furthermore, directly feeding the full volume of code, invocation chains, or massive API contexts into LLMs easily triggers context window truncation and incurs exceedingly high token overhead. Most crucially, some methods treat LLMs merely as feature summarization tools. They fail to truly unleash the immense potential of LLMs for deep logical reasoning within complex, malicious behaviors.
No training required, cost as low as $0.10
Chain of evidence
Our architecture: MARD
Fig. 1. Comparison of different scheme architectures.
In the feature semantic enhancement paradigm, there is a tendency to treat the LLM as an advanced feature extractor to compensate for the deficiencies of traditional machine learning models in semantic understanding. AppPoet [31] prompts the LLM to generate natural language summaries for three distinct views: permissions, APIs, and URLs & Uses-features. These summaries are subsequently fed into a Deep Neural Network (DNN) for downstream classification. Yan et al. [33] and Li et al. [32] leveraged LLMs to translate obscure API call sequences or code invocation chains into descriptive text enriched with domain knowledge. CNN-based or unsupervised learning models then process this text to perform anomaly detection. Furthermore, SRDC [30] utilizes a ransomware semantic knowledge base, collaboratively constructed by human experts and LLMs, to pre-train a GPT-2 model. This pre-training enhances the model’s capability to capture the semantics of zero-day attacks. Conversely, the direct reasoning analysis paradigm attempts to stimulate and harness the autonomous decision-making and end-to-end adjudication potential of LLMs. AV-Agent [34] integrates the confidence scores of ML models and key string features into two distinct reasoning stages of the LLM to yield the final analysis result. LLMalware [46] utilizes LLMs to achieve automated feature extraction and fusion. It mitigates the concept drift problem by dynamically updating an external knowledge base. At a more fine-grained level, CAMA [35] delves into the function level. It requires the LLM to output function summaries and quantified maliciousness scores to evaluate localized malicious intent. LAMD [36] proposes a progressive framework starting from predefined suspicious APIs. It sequentially feeds the extracted structured knowledge into the LLM according to a Function-API-APK hierarchical structure to make the final adjudication. Despite the significant progress achieved by the aforementioned explorations, some studies remain highly dependent on downstream classifiers. This dependency constrains the
Data-flow-based static analysis tools provide high determinism and precise instruction-level tracking capabilities, yet they fundamentally lack an understanding of high-level malicious semantics and the true intent of developers. Conversely, LLMs exhibit remarkable emergent capabilities in zero-shot semantic reasoning. However, their direct application to massive raw Android Application Packages (APKs) is entirely infeasible due to strict context window constraints. Consequently, we propose MARD, a multi-agent framework for robust Android malware detection. As illustrated in Fig. 2, MARD deeply integrates the continuously escalating high-order semantic reasoning capabilities of LLMs with underlying static analysis engines. This integration constructs an architecture capable of executing high-dimensional intent reasoning and low-level logical forensics without requiring any domain-specific finetuning. Our architecture consists of four core modules: Deterministic Static Representation. Serving as the data foundation of the system, this module leverages the Apktool and Soot engines to perform reverse engineering and dimensionality reduction on the APK. It extracts critical configuration metadata from AndroidManifest.xml. Furthermore, it elevates obscure Dalvik bytecode into the Jimple Intermediate Representation (IR), which closely aligns with human semantics. Additionally, it pre-constructs a global Call Graph (CG) and an API inverted index. Macro-level Heuristic Screening. The Reconnaissance Agent conducts a review of the Manifest through cross-modal semantic analysis. This process precisely identifies semantic misalignments between the application’s declared intent and its requested permissions. Subsequently, it utilizes these macrolevel warnings to perform extensive filtering across the global API index. This action exponentially condenses the vast search space into a minimal set of high-risk API candidates. Consequently, it significantly alleviates the cognitive load and token overhead for subsequent deep analysis. Micro-level Autonomous Forensics. Acting as the definitive forensic hub of the system, the Traceability Agent dynamically drives the underlying advanced static analysis tools. Targeting the high-risk API candidates, the agent autonomously plans analytical actions. It commands the backend engines to execute backward call graph traversal to determine the triggering source. Moreover, it issues taint analysis and program slicing instructions to trace the precise data-flow context. After multiple iterations, fragmented code snippets are abstracted into conclusive evidence vectors with strict topological constraints.
Phase 2: Reasoning Multi Agent LLM and Report Results
Phase 1: Static Preprocessing
Tier 1: Reconnaissance Agent (Macro Profiling) Semantic Analysis XML
Intent-Permission Mismatch
Manifest
Tier 2: Forensics Tracing Hub
API
Raw Android APK
Traceability Agent (Micro forensic tracking) System API
Tools Box (Java Backend Engines)
Trigger Entry Point Tracing
Soot Slicer Requests and receives data
Data Flow Context APKtool
Suspicious API Candidates
Call Graphs
FlowDroid Call Graph Tracker
Tier 3: Verdict Agent (Comprehensive Adjudication)
Soot
Benign Tier 1 Result
Tier 2 Result
Java
Analyse
Jimple IR
Comprehensive Reasoning and Logical Deduction
Json
Malware
Final Analysis Report
Fig. 2. Overview of the MARD Architecture.
Multi-dimensional Evidence Fusion. The Verdict Agent, situated at the apex of the architecture, is responsible for completing the global logical closed loop. It deeply fuses the macro-level intentional risks extracted in Tier 1 with the structured, micro-level definitive evidence vectors from Tier 2. Based on this fusion, it executes high-order logical deduction and alignment with threat modeling. Ultimately, this agent outputs a standardized JSON analysis report. IV. P ROPOSED M ETHODOLOGY This section details the overall design and implementation of the MARD framework. By constructing a reduceddimensional data foundation through deterministic analysis engines and relying on multi-agent collaboration to execute high-order semantic reasoning, this framework achieves endto-end autonomous analysis and adjudication, bridging syntaxlevel program features to intent-level security semantics. A. LLM-Oriented Deterministic Code Representation and Dimensionality Reduction Android applications typically contain millions of lines of highly obfuscated Dalvik bytecode. To transform this convoluted binary logic into structured knowledge computable by LLMs, we construct a deterministic data foundation. Given a target application A, we first extract its global configuration manifest M through reverse engineering. For the core logic code, we utilize the Soot engine to disassemble and elevate the Dalvik bytecode into the Jimple IR. As a strongly-typed three-address code, Jimple abstracts away register allocation and low-level execution details. Simultaneously, it preserves control-flow semantics close to the source code level. This abstraction significantly reduces the complexity of program analysis.
Building upon this, we perform fine-grained syntax tree parsing on the Jimple IR to extract the comprehensive set of API calls P. Furthermore, we introduce the Android system API set W (built upon the Android SDK API Level 36) to perform semantic filtering on P. This step removes thirdparty library and framework calls, achieving noise suppression and search space compression. Ultimately, we construct the application’s global call graph G = (V, E), where nodes V represent methods and edges E denote invocation dependencies. In addition, we build an API inverted index space with O(1) time complexity. This index precisely maps each suspicious API signature to specific nodes and code lines in the abstract syntax tree. Consequently, it provides exact coordinates for the subsequent micro-level navigation of the agents. B. Intent-Permission Semantic Alignment Based on Zero-Shot Reasoning After completing the syntax-level dimensionality reduction, the system’s Reconnaissance Agent first intervenes at the macro level. This stage simulates the heuristic screening process of security experts. It rapidly locates potential attack surfaces by reasoning about the semantic consistency between the application’s declared intent and its permission requests. Specifically, the Reconnaissance Agent takes the manifest file M as input. It leverages the zero-shot commonsense reasoning capabilities of the LLM to extract the application’s declared intent set Idecl , and the actually requested sensitive permission set Preq . Internally, the agent implicitly evaluates the semantic consistency between Idecl and Preq based on the LLM’s prior knowledge. When a discrepancy between the application’s functional scope and its requested permis-
sions triggers a structured risk signal, it indicates a potential privilege overreach. For instance, a simple tool application requesting an unreasonable READ_SMS permission would be flagged as a high-risk anomaly. Based on these macro-level warnings, the Reconnaissance Agent performs mapping within the pre-constructed API inverted index. It prunes the raw API set P into a minimal, high-risk API candidate subset Csus . As illustrated in Fig. 3, this process significantly condenses the search space and effectively minimizes the token overhead of LLM reasoning.