Skip to content
AI360Xpert
Beta

EfficientFormer Speeds Attention on Phones

EfficientFormer keeps 4D convs early and slim 3D attention late with latency driven sizing, so phones hit live ViT speed.

Pool mixers early plus attention late cut phone latency 3 times
Pool mixers early plus attention late cut phone latency 3 times

Why Does This Exist?

Phone GPUs run convs fast but reshape heavy attention slowly. Plain ViTs miss live budgets by multiples.

EfficientFormer sizes by latency. It fits efficient architectures, rivals mobilevit sizing, and serves image classification live.

Think of It Like This

Bikes for alleys plus cars for highways

You bike narrow alleys where cars stall, then drive highways where bikes crawl. Each leg uses the faster vehicle.

Pool mixers are bikes, late attention cars. Where it stops: biking highways wastes time, just as pooling late loses accuracy.

How It Actually Works

Stages 1-2 use 4D MetaBlocks with pool mixing (no attention). Stages 3-4 flatten to 3D and run slim attention with small MLPs. Search widths by iPhone ms, not FLOPs.

Worked example

56×5656 \times 56 pool mixing costs 31363136 ops linear. Late 14×14=19614 \times 14 = 196 attention costs 1962=38196^2 = 38K pairs. All-attention 5656 would cost 9.89.8M, about 256256 times more. Latency 1212 ms to 44 ms per block in paper phone runs, 33 times faster at 7979 percent.

Watch Out For

Sizing by FLOPs instead of phone ms

Pool versus attention FLOPs misrank phone speed. Symptom: low FLOP model slower on device. Fix: search with on-device latency as EfficientFormer does.

The Quick Version

  • EfficientFormer pools early in 4D and attends late in 3D.
  • Latency search picks widths for phones, not FLOPs.
  • Fixture late 3838K pairs beat early 9.89.8M by 256 times.
  • Phone blocks drop 1212 ms to 44 ms at 7979 percent.
  • Size by measured ms before publishing speed claims.