arXiv:2511.17573cs.LGcs.AI2025-11被引 2

为二进制分析设计跨平台分词器,提升模型处理效率

Binary BPE: A Family of Cross-Platform Tokenizers for Binary Analysis

  • 基于BPE训练跨平台二进制分词器,适配多架构与系统
  • 单个分词可压缩多字节,固定上下文窗口内容量提升2-3倍
  • 支持从边缘设备到数据中心的部署,适用于恶意软件检测等场景

用于二进制分析的序列模型受限于字节级分词:原始字节会浪费变压器等神经网络的上下文窗口容量,而现有文本导向分词器无法有效处理0x00–0xFF任意字节序列。为此,我们提出Binary BPE分词器家族,基于涵盖多个平台、架构和操作系统的大型二进制语料库训练,包括Linux、Windows、macOS、Android及恶意软件源。发布4K、8K、16K、32K和64K词表的预训练分词器,支持系统性扩展研究与实际部署。该分词器能发现可解释模式(如ELF/PE头、指令序列、跨平台字符串),实现每个分词对应多字节压缩。在典型未压缩可执行文件(如ELF/PE/Mach-O)上,相比原始字节,固定长度变压器上下文窗口内可容纳约2-3倍的二进制内容,显著提升内容识别、恶意软件检测、逆向工程与优化任务的研究效率与实用性。分词器已开源发布于HuggingFace,可直接用于二进制语言模型与上下文高效智能体工具。

原文摘要 · Abstract (English)

Sequence models for binary analysis are bottlenecked by byte-level tokenization: raw bytes waste precious context window capacity for transformers and other neural network architectures, and many existing text-oriented tokenizers fail on arbitrary 0x00--0xFF sequences. To address this issue, we introduce the Binary BPE tokenizer family, a set of cross-platform Byte Pair Encoding (BPE) tokenizers for executables trained on a large corpus of binaries spanning multiple platforms, architectures, and operating systems, including Linux, Windows, macOS, Android, and malware sources. We release trained tokenizers with vocabularies of 4K, 8K, 16K, 32K, and 64K tokens, enabling both systematic scaling studies and practical deployment from resource-constrained edge devices to high-throughput datacenters. These tokenizers discover interpretable patterns (ELF/PE headers, instruction sequences, cross-platform strings) while yielding multi-byte compression per token. On representative uncompressed executables (e.g., ELF/PE/Mach-O rather than compressed APKs), the Binary BPE tokenizers typically allow for roughly 2-3x more binary content per fixed-length transformer context window than raw bytes, enabling more efficient research and practical deployment for content identification, malware detection, reverse engineering, and optimization. We release the trained Binary BPE tokenizers on HuggingFace, providing a drop-in, open-source foundation for binary-focused language models and context-efficient agentic tools.

二进制分析分词器BPE安全

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。