aiqbench analysis
MimeLens introduces position-agnostic BERT-style encoders capable of classifying binary fragments from arbitrary offsets, outperforming Magika on mid-stream packets and random disk blocks while maintaining competitive accuracy on complete files. The primary trade-off is increased CPU latency, though performance aligns with Magika on consumer GPUs or in batch processing scenarios. This advancement addresses critical gaps in forensic carving, malware triage, and packet inspection where whole-file access is unavailable.
MimeLens: Position-Agnostic Content-Type Detection for Binary Fragments
arXiv:2606.04171v1 Announce Type: cross Abstract: File-type classification underlies many workflows like malware triage, forensic carving, packet inspection, and storage indexing. Learned systems such as Google's Magika assume whole-file access at a known offset, so they break on the inputs many of these tasks actually produce, like a single packet payload, a header-less carved fragment, a random disk block, or a chunked upload. We introduce MimeLens, a family of small BERT-style encoders pretrained on binary content from windows sampled at a uniformly random offset within each file, with no privileged head-of-file position, in standard- and short-context variants. A byte chunk goes in from anywhere in a file, no header needed and no fixed size; out comes one of libmagic's 125 MIME labels. On the clean head of complete files, MimeLens beats Magika v1.1 by +10.7 pp top-1 on libmagic-labeled data, and it keeps classifying where Magika cannot: from a single mid-stream UDP packet, and more than twice as accurately as libmagic and Magika on random mid-file disk blocks. The cost is latency: MimeLens runs roughly one to two orders of magnitude slower per sample on CPU than Magika, though it matches on consumer GPUs or in batch. All trained checkpoints are released on Hugging Face (mjbommar/mimelens-001-*).
Abstract:File-type classification underlies many workflows like malware triage, forensic carving, packet inspection, and storage indexing. Learned systems such as Google's Magika assume whole-file access at a known offset, so they break on the inputs many of these tasks actually produce, like a single packet payload, a header-less carved fragment, a random disk block, or a chunked upload. We introduce MimeLens, a family of small BERT-style encoders pretrained on binary content from windows sampled at a uniformly random offset within each file, with no privileged head-of-file position, in standard- and short-context variants. A byte chunk goes in from anywhere in a file, no header needed and no fixed size; out comes one of libmagic's 125 MIME labels. On the clean head of complete files, MimeLens beats Magika v1.1 by +10.7 pp top-1 on libmagic-labeled data, and it keeps classifying where Magika cannot: from a single mid-stream UDP packet, and more than twice as accurately as libmagic and Magika on random mid-file disk blocks. The cost is latency: MimeLens runs roughly one to two orders of magnitude slower per sample on CPU than Magika, though it matches on consumer GPUs or in batch. All trained checkpoints are released on Hugging Face (mjbommar/mimelens-001-*).
18 pages, 2 figures, 15 tables. Models released on Hugging Face (this https URL reference training code at this https URL
Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI); Machine Learning (cs.LG)
arXiv:2606.04171 [cs.CR]
(or arXiv:2606.04171v1 [cs.CR] for this version)
https://doi.org/10.48550/arXiv.2606.04171 Focus to learn more arXiv-issued DOI via DataCite (pending registration)
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Full text under the publisher's open licence · 322 words
Related coverage

Auditor-in-a-Box: Tools for Third-Party Auditing
LessWrong · Jul 28, 2026

Reducing medical claims review time with AI on AWS: The EXL Medical IDP solution
AWS · Sep 21, 2026

Deconfusing Corrigibility
AI Alignment Forum · Oct 17, 2026

2026.9: There's room on this bus
Home Assistant · Sep 2, 2026