All models

ByteFormer

ByteFormer is a transformer that classifies a file directly from its bytes, with no decoding step.

Image classification · 706 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (69 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
16.8M
Operations
706
Framework
PyTorch
Recurrent
No
Published
Transactions on machine learning research (arXiv 2023)
Cited by
22 (as of 23 November 2026)
Authors
Maxwell Horton, Sachin Mehta, Ali Farhadi, Mohammad Rastegari
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m15008
Graph hash
3484a374a2d092bc1b9df70a3f8f239af117709451e3a33c8966eaf923d10591
Skeleton hash
fbbf094fb0c96d62c05a13091f04de571058577a1d818898211bf0b0b04a752c
Architecture hash
0d5b4577e3e227f32325ade28db6ece5145c6803d1c5063d186f8550581370db
Diagram SHA-256
7a83b52223e6eaab5a4319fe8fc811c9fe2300340b555d731fed872297024ee1
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

ByteFormer is a transformer that classifies a file from its raw bytes, with no decoding step at inference time. The paper sets this against the usual image pipeline, in which file bytes are first decoded into an RGB tensor before a network sees them. Skipping that step means the model needs no hand-designed processing tied to one modality.

On ImageNet the paper reports 77.33% Top-1 accuracy, against 72.2% for DeIT models of similar size. Compared with Perceiver IO, the authors say ByteFormer needs no modality-specific processing at inference time and uses an order of magnitude fewer parameters at equivalent ImageNet accuracy.

The same architecture is applied to audio without modification, and the paper reports 95.42% classification accuracy on the Speech Commands V2 dataset. It can also be run jointly on images and audio, classifying inputs without explicit knowledge of which modality it was given. The code was released in version 0.4 of the CVNets library.

Key idea. ByteFormer classifies inputs directly from file bytes, without decoding files at inference time, so one architecture handles images and audio with no modality-specific processing.

  • byteformer
  • bytes are all you need
  • file bytes
  • classification on file bytes
  • image classification
  • audio classification
  • modality-independent
  • cvnets

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{horton2024bytesneedtransformersoperating,
      title={Bytes Are All You Need: Transformers Operating Directly On File Bytes}, 
      author={Maxwell Horton and Sachin Mehta and Ali Farhadi and Mohammad Rastegari},
      year={2024},
      eprint={2306.00238},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2306.00238}, 
}