AGNOMIN: Architecture-Agnostic Function Prediction
- AGNOMIN is an architecture-agnostic, multi-label function name prediction system that reconstructs semantic tokens for stripped binaries using advanced graph neural networks.
- Its design integrates Feature-Enriched Hierarchical Graphs and a T5-based PCode encoder to capture both intra-function control flow and inter-procedural context.
- Evaluation on a diverse ELF executables corpus demonstrates significant improvements over state-of-the-art methods, enabling scalable reverse engineering and vulnerability analysis.
AGNOMIN, short for Architecture Agnostic Multi-Label Function Name Prediction, is an architecture-agnostic, multi-label function name prediction system for stripped binaries. It is designed to close the semantic gap created when symbol tables are removed by predicting informative, compositional labels that reconstruct function names across CPU architectures. The system combines Feature-Enriched Hierarchical Graphs (FEHGs), a hierarchical graph neural network, and a Ren-inspired decoder with an attention-based head tailored to extreme multi-label spaces. On a corpus of 396,096 functions from 9,000 ELF executables spanning amd64, armel, and i386, it reports improvements of up to 27.17% in precision and 55.86% in recall over state-of-the-art baselines, and achieves 5.89% higher recall than the closest baseline on an unseen architecture (Achamyeleh et al., 29 Sep 2025).
1. Problem setting and motivation
Function name prediction in stripped binaries is a reverse-engineering task in which informative names must be inferred after symbols have been removed. The task is pivotal to understanding program semantics and enabling downstream tasks including vulnerability discovery, patch matching, crypto migration, and malware triage. AGNOMIN is framed around the observation that vulnerable programs and malware are routinely cross-compiled and deployed across multiple architectures, so architecture-specific predictors degrade when retargeted and make scalable security assessment and patching impractical (Achamyeleh et al., 29 Sep 2025).
The system targets three difficulties identified in prior work. The first is architecture-specific limitation: many approaches rely on features tied to a particular ISA, whereas AGNOMIN uses PCode, Ghidra’s intermediate representation, to learn architecture-neutral semantics. The second is data scarcity and label imbalance: rare function names and uncommon architectures degrade generalization, motivating a multi-label formulation, hierarchical label embeddings, and propensity-aware evaluation. The third is naming convention diversity: function names appear in forms such as snake_case, camelCase, PascalCase, and concatenated strings, so AGNOMIN normalizes and tokenizes names with heuristics, dynamic programming segmentation, and abbreviation expansion (Achamyeleh et al., 29 Sep 2025).
A central conceptual shift is that AGNOMIN predicts semantic tokens rather than directly generating a single monolithic string. This multi-label formulation allows a function to be described compositionally, which is better aligned with the heterogeneity of naming conventions and the long-tail label distribution observed in real binary corpora. A plausible implication is that the model is optimized for semantic recoverability rather than exact string reproduction.
2. Feature-Enriched Hierarchical Graphs
AGNOMIN represents each binary as a Feature-Enriched Hierarchical Graph that combines local control-flow structure, inter-procedural calling structure, and learned PCode-derived semantics. At the binary level, the FEHG is defined as
where are function nodes, encodes call-graph edges, and maps each function to its learned feature set. Each function is itself a Feature-Enriched CFG,
where are basic blocks, are intra-function CFG edges, and gives learned PCode features for basic blocks (Achamyeleh et al., 29 Sep 2025).
At the basic-block level, the representation uses
- for basic-block features,
- 0 for CFG adjacency.
Pooling yields a function-level representation:
1
with assignment 2, and a scalar self-structure summary
3
At the binary level, 4 concatenates pooled embeddings with function-level PCode features 5, and 6 is the function call graph adjacency. The paper also gives a merged formalization,
7
while noting that AGNOMIN processes the hierarchy explicitly rather than as a single merged matrix (Achamyeleh et al., 29 Sep 2025).
PCode features are obtained with a pre-trained T5 encoder. For a basic block and a function, respectively,
8
These features populate the basic-block and function-level inputs. Feature fusion is then defined by concatenating the pooled block embedding 9 with function-level PCode semantics:
0
This representation encodes both intra-function control and inter-function context. The explicit use of PCode suggests that architecture invariance is sought primarily at the IR-semantic level rather than by forcing direct alignment between raw instruction sequences.
3. Hierarchical graph encoder and cross-architecture regularization
The encoder is a two-level hierarchical graph neural network. Within each function, AGNOMIN applies a normalized GCN over the CFG:
1
2
initialized with 3. After 4 layers, block embeddings are pooled to obtain the function representation:
5
Across functions, AGNOMIN uses a graph attention network over the FCG. For function nodes 6 and 7,
8
9
The final fused function embedding is
0
The paper reports that replacing the GAT with a fully connected layer degrades performance, which it interprets as evidence that inter-procedural attention is materially useful (Achamyeleh et al., 29 Sep 2025).
To promote cross-architecture consistency, AGNOMIN trains a Siamese head with contrastive loss. For semantically similar cross-architecture pairs,
1
2
where 3 for semantically similar pairs and 4 is a margin. This regularizer is intended to pull architecture-equivalent functions together in embedding space. It does not imply that architecture-specific variation disappears entirely; rather, the learned representation is optimized so that semantic similarity dominates architecture-specific surface differences.
4. Multi-label name prediction and decoder design
AGNOMIN’s decoder is described as inspired by Renee, an end-to-end extreme multi-label classification model, but the system explicitly decouples encoder and decoder so that the encoder can preserve architecture-agnostic function semantics. On top of encoder outputs 5, a multi-head self-attention layer computes
6
with per-head attention
7
and projection
8
With label embeddings 9, label scores and predictions are
0
Hierarchical label embeddings and dynamic label pruning are used to reduce search space and capture label relations in extreme multi-label settings (Achamyeleh et al., 29 Sep 2025).
The label space is constructed by decomposing function names into semantic tokens. The normalization pipeline includes splitting on non-alphanumeric delimiters and case changes, dynamic programming segmentation into longest non-overlapping dictionary words, fallbacks using subsequence and Levenshtein similarity, and abbreviation expansion via a curated dictionary. Rare or noisy labels are pruned to focus on the 1 most common labels, with 2 (Achamyeleh et al., 29 Sep 2025).
For function 3, the decoder predicts a binary vector over labels,
4
with binary cross-entropy
5
To address class imbalance, AGNOMIN uses class-weighted BCE:
6
with larger 7 for rare labels. The encoder’s contrastive loss is added during embedding training, while the decoder is trained on fixed embeddings (Achamyeleh et al., 29 Sep 2025).
A common misunderstanding is to treat AGNOMIN as direct sequence generation. The formulation in the paper is instead extreme multi-label prediction over normalized semantic tokens. This matters because evaluation, pruning, imbalance handling, and label embeddings are all built around token-level prediction rather than autoregressive string decoding.
5. Dataset, evaluation protocol, and reported results
The experimental corpus is the Diverse Architecture Binary (DAB-9k) dataset, drawn from ALLSTAR (Debian Jessie packages). It contains 9,000 ELF executables and 396,096 functions across amd64, armel, and i386. The train/test split is a package-aware non-random 9:1 split, so binaries from the same package do not cross splits. Reported test subsets include DAB-amd-test, DAB-i386-test, DAB-armel-test, and a combined DAB-3arch-test (Achamyeleh et al., 29 Sep 2025).
Evaluation uses both standard and propensity-aware extreme multi-label metrics. These include
8
9
0
along with PSDCG@k, PSnDCG@k, and standard Precision, Recall, and F1 (Achamyeleh et al., 29 Sep 2025).
The paper reports several headline comparisons. Against XFL (amd64), AGNOMIN improves P@1 by 29.83%, P@5 by 27.17%, Recall by 54.32%, PSP by 44.53%, and PSnDCG by 33.64%. Against SymLM, it improves precision by up to 11.88% and recall by up to 55.86% across architectures. SymLM’s cross-architecture transfer is reported to degrade severely, with recall 3.91% when tested on i386 from an amd64-trained model, whereas AGNOMIN retains 47.25% recall under the same transfer setting. For unseen architecture generalization with training on amd64+armel and testing on i386, AGNOMIN achieves 3.12% higher precision and 5.89% higher recall than CFG2VEC, the closest baseline. Across all three architectures, its cross-architecture model beats CFG2VEC by 25.56% P@5 and 35.51% recall (Achamyeleh et al., 29 Sep 2025).
Ablations attribute a substantial portion of the gain to 128-dimensional PCode features and the attention head. The encoder is also reported to outperform CFG2VEC in name-level matching, with a representative figure of 91.55% vs ~69–71% across architectures. The paper summarizes the source of these gains as the combination of FEHG structure, PCode/T5 semantics, hierarchical aggregation, attentive decoding, and the multi-label formulation (Achamyeleh et al., 29 Sep 2025).
6. Practical utility, implementation, and limitations
AGNOMIN is implemented as a Ghidra plugin that extracts CFGs, FCGs, and PCode; the encoder and decoder are implemented in PyTorch; the attention head uses torch.nn.MultiheadAttention; and PCode features are obtained via a pre-trained T5 encoder. The encoder is trained for 100 epochs while varying PCode feature configurations at 32/64/128 dimensions for basic-block and function-level features. Decoder attention depth is tuned, with a default of 5 heads. Label-space pruning is performed for 1, with 512 often yielding highest metrics while 4096 retains stable performance because of hierarchical label embeddings (Achamyeleh et al., 29 Sep 2025).
Reported runtime on NVIDIA V100/A30/A100 GPUs is approximately 46h / 35h / 32h for encoder training and 13.4h / 9h / 9h for decoder training. Inference per binary is about 0.4–0.7s for the encoder and about 37–43s for the decoder. The decoupled encoder allows function embeddings to be precomputed and reused across tasks, while dynamic label pruning is intended to keep inference practical in extreme label spaces (Achamyeleh et al., 29 Sep 2025).
The system was also validated in DARPA-sponsored hackathons. In a NASA rover scenario (AARCH64 v8A), without training on AARCH64, AGNOMIN’s function matching identified 51/64 (79.7%) targets top-1, increasing to 92.1% top-3, which enabled precise micro-patch insertion through “sharpen” function redirection. In a deprecated crypto remediation case, the model matched vulnerable crypto routines in a stripped binary to a secure reference and reduced the search space for patching. Example predicted label sets such as {"lib", "string", "in", "hmac", "fin"} are presented as compositional cues that map toward canonical crypto helper or HMAC finalization routines (Achamyeleh et al., 29 Sep 2025).
The paper also delineates several limitations. Heavy obfuscation and aggressive compiler transformations can distort control structure and semantics despite the use of PCode IR and hierarchical GNNs. Rare naming conventions and domain-specific vocabularies remain difficult despite pruning and propensity-aware evaluation. Cross-architecture claims are validated on amd64, armel, and i386, while broader validation on MIPS, PPC, s390x, and AARCH64 is identified as future work. The paper proposes future directions including obfuscation-aware features, cross-binary contrastive augmentation, expanded multilingual/token dictionaries, and unifying inference with patch graph alignment (Achamyeleh et al., 29 Sep 2025).
Taken together, AGNOMIN defines a specific architecture-agnostic approach to binary semantic recovery: it uses PCode-mediated FEHGs to encode binaries as graph-structured semantic objects, regularizes embeddings for cross-architecture consistency, and treats function naming as an extreme multi-label prediction problem over normalized semantic tokens. This design is aimed not merely at label prediction in isolation, but at enabling scalable reverse engineering, vulnerability analysis, and patching workflows across heterogeneous architectures.