← Questions
Vision encoders and LLM bottlenecks
0
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Apple's technical phone screen, last asked Nov 2025. It tests vision, llm and inference performance.
A machine learning fundamentals conversation in two halves: vision encoders, then what limits large language model inference and how to speed it up.
Questions
- What is a vision encoder, and what does it do in a computer vision or multimodal model?
- How is a vision encoder usually trained?
- What are the main bottlenecks of LLM inference?
- How would you reduce LLM inference memory and latency?
What a strong answer covers
- Vision encoders: CNNs and Vision Transformers that turn an image (as patches) into embeddings; in multimodal models a projection or cross-attention connects those embeddings to the language model.
- Training: supervised classification on labeled images, contrastive image-text training (CLIP-style), self-supervised methods (masked image modeling, DINO-style distillation), and then fine-tuning or alignment with the language model.
- LLM bottlenecks: the prefill phase is compute-bound; decoding one token at a time is memory-bandwidth-bound; the KV cache grows with batch size and context length and limits how many requests fit; attention cost grows with sequence length.
- Memory and latency fixes: quantization of weights and KV cache, grouped-query or multi-query attention, paged KV cache memory, continuous batching, FlashAttention-style kernels, speculative decoding, tensor and pipeline parallelism, prefix caching, distillation into a smaller model.
- For each fix, what it costs (quality, complexity, hardware support).
Follow-ups
- Estimate the KV cache size for a given model, batch size and context length.
- Time to first token is fine but tokens per second is poor. Where do you look?
- How would you cut the cost of the image tokens in a multimodal model?
Where it's asked
- Apple · Technical phone screen · Last asked Nov 2025
What it tests
vision · llm · inference performance
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
