← Adobe Interview Insights

Adobe·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Adobe ML engineer interview that leaned hard into transformer architecture fundamentals. The questions were focused and technical, no fluff, just a deep dive into how attention mechanisms actually work under the hood.

Questions Asked (4)

Q1

What is the difference between encoder and decoder transformers, and what are they each used for?

Technical Trade-offsSystem Design
Author's notes

Felt okay about this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core architectural difference: encoders process the entire input bidirectionally to build rich representations, while decoders generate outputs autoregressively using causal masking. Then map each to its typical use cases—encoders for understanding tasks like classification, decoders for generation tasks like text synthesis—and briefly mention encoder-decoder hybrids for sequence-to-sequence problems.

Pro tip: Tie the architecture choice to concrete trade-offs in latency, memory, and task suitability—e.g., encoders can parallelize but can't generate, decoders generate but are slower—and mention how this influences system design decisions at scale.

1. Define the core architectural difference

Explain that encoders use bidirectional self-attention (no masking) to see the full input, while decoders use causal (masked) self-attention to prevent looking ahead during generation.

2. Describe the training objective and information flow

Highlight that encoders are typically trained with masked language modeling or similar objectives to learn representations, whereas decoders are trained with next-token prediction to model a probability distribution over sequences.

3. Map architectures to primary use cases

Give examples: encoders for understanding tasks (classification, NER, sentiment analysis), decoders for generation tasks (text completion, summarization, translation), and encoder-decoder models for sequence-to-sequence tasks (translation, summarization).

4. Discuss trade-offs and system design implications

Compare inference speed, memory usage, and flexibility: encoders can process inputs in parallel but cannot generate; decoders generate sequentially but are slower; encoder-decoder models combine both but add complexity.

5. Connect to real-world examples and Adobe context

Mention popular models (BERT as encoder, GPT as decoder, T5 as encoder-decoder) and relate to Adobe's use cases like document understanding, image captioning, or content generation.

Key Points to Mention

  • Bidirectional vs. causal (masked) self-attention
  • Training objectives: masked language modeling vs. autoregressive next-token prediction
  • Typical use cases: understanding (classification, NER) vs. generation (text completion, translation)
  • Encoder-decoder architectures for sequence-to-sequence tasks
  • Trade-offs: parallelization vs. sequential generation, latency, and memory
  • Examples: BERT (encoder), GPT (decoder), T5/BART (encoder-decoder)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How does bidirectional attention differ from causal masked attention, and why does each approach exist?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This is the kind of question that sounds easy until you're actually explaining it out loud.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining both attention mechanisms clearly, then contrast their information flow and training objectives. Explain why each exists by linking to specific architectures and tasks, such as bidirectional attention for understanding tasks and causal attention for generation.

Pro tip: Mention that causal masking is essential for autoregressive generation to prevent information leakage, while bidirectional attention enables richer context for tasks like classification or question answering. Also note that some models combine both, e.g., prefix LM or encoder-decoder architectures.

1. Define Bidirectional Attention

Explain that in bidirectional attention, each token can attend to all other tokens in the sequence, both left and right. This allows the model to build a deep, context-aware representation of each token.

2. Define Causal Masked Attention

Explain that causal masked attention restricts each token to attend only to previous tokens and itself, preventing access to future tokens. This is achieved via a triangular mask.

3. Contrast Information Flow

Highlight that bidirectional attention has full information flow, while causal attention enforces a unidirectional flow. This difference impacts how representations are formed and what tasks each is suited for.

4. Explain Why Each Exists

Discuss that bidirectional attention is used in models like BERT for tasks requiring full context (e.g., classification, QA). Causal attention is used in autoregressive models like GPT for generation, where future tokens must not be seen during training.

5. Mention Trade-offs and Use Cases

Summarize that bidirectional attention captures richer context but cannot be used for generation without leakage, while causal attention enables generation but may have less context. Some architectures combine both (e.g., encoder-decoder, prefix LM).

Key Points to Mention

  • Bidirectional attention allows each token to attend to all tokens, while causal attention only attends to previous tokens.
  • Causal masking is implemented with a triangular mask to prevent future information leakage.
  • Bidirectional attention is used in encoder-only models (e.g., BERT) for understanding tasks.
  • Causal attention is used in decoder-only models (e.g., GPT) for autoregressive generation.
  • The choice depends on the task: full context for understanding vs. sequential generation.
  • Some models combine both, such as encoder-decoder transformers or prefix LM.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How does cross-attention work in an encoder-decoder architecture?

System DesignTechnical Trade-offs
Author's notes

Managed to explain that the decoder generates queries while keys and values come from the encoder output.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining cross-attention as the mechanism that lets the decoder attend to encoder outputs, then explain the query-key-value computation and how it differs from self-attention. Finally, connect it to the encoder-decoder workflow and discuss trade-offs like computational cost and design choices.

Pro tip: Emphasize that cross-attention is the bridge between modalities or languages, and mention that its efficiency can be optimized via techniques like caching or sparse attention—showing you think beyond textbook definitions.

1. Define cross-attention

Explain that cross-attention allows the decoder to focus on relevant parts of the encoder's output by computing attention between decoder queries and encoder keys/values.

2. Describe the computation

Walk through the steps: project decoder hidden states to queries, encoder outputs to keys and values, compute scaled dot-product attention, and produce a weighted sum of values.

3. Contrast with self-attention

Highlight that in self-attention, queries, keys, and values come from the same sequence, while in cross-attention they come from different sequences (decoder vs. encoder).

4. Explain its role in the architecture

Discuss how cross-attention is inserted between self-attention and feed-forward layers in each decoder block, enabling the decoder to condition on the entire input sequence.

5. Discuss trade-offs and optimizations

Mention computational complexity (O(n*m) for sequence lengths n and m), memory usage, and techniques like caching encoder outputs or using sparse attention for efficiency.

Key Points to Mention

  • Query, key, and value projections and their sources
  • Scaled dot-product attention and softmax normalization
  • Masking in cross-attention (e.g., for padding)
  • Difference from self-attention in terms of input sequences
  • Role in sequence-to-sequence tasks like translation or text-to-image generation
  • Computational complexity and optimization strategies

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Why don't encoder-only models need a KV cache during inference?

System DesignTechnical Trade-offs
Author's notes

This one tripped me up more than it should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the fundamental difference in how encoder-only and decoder-only models use attention during inference. Explain that encoder-only models process the entire input sequence in parallel with bidirectional attention, so there is no need to cache past keys/values because each token's representation is computed once and reused. Contrast this with autoregressive decoding, where the KV cache is essential to avoid recomputing past tokens.

Pro tip: Emphasize that the KV cache is an optimization for autoregressive generation, not a requirement for attention itself; encoder-only models are not generative in the same way, so the concept doesn't apply. This shows you understand the underlying mechanics rather than just memorizing facts.

1. Define encoder-only models and their inference pattern

Explain that encoder-only models (e.g., BERT) take a full input sequence and produce contextualized embeddings for each token in a single forward pass, with no autoregressive generation.

2. Describe attention in encoder-only models

Highlight that self-attention is bidirectional and computed over the entire sequence at once, so all keys and values are available simultaneously and used only once per inference.

3. Explain the purpose of KV cache in decoder-only models

Clarify that in autoregressive decoding, tokens are generated one at a time, and the KV cache stores previously computed keys and values to avoid recomputing them for each new token.

4. Contrast the two paradigms

Point out that encoder-only models do not generate tokens sequentially, so there is no repeated use of past keys/values; hence a cache would provide no benefit and is unnecessary.

5. Conclude with implications

Summarize that the absence of a KV cache in encoder-only inference is a natural consequence of their parallel, non-autoregressive nature, and mention that this makes them efficient for tasks like classification or embedding extraction.

Key Points to Mention

  • Encoder-only models process the entire input sequence in parallel, not token-by-token.
  • Self-attention in encoders is bidirectional, using all tokens simultaneously.
  • KV cache is an optimization for autoregressive decoding to avoid recomputing past keys/values.
  • Decoder-only models generate tokens sequentially, requiring the cache for efficiency.
  • Encoder-only models are typically used for non-generative tasks (e.g., classification, embeddings).
  • Without autoregression, there is no repeated computation of past tokens, so caching is irrelevant.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.