← Amazon Interview Insights

Amazon·Research Scientist·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Concept-heavy technical screen at Amazon for an RS role, focused almost entirely on LoRA and its PEFT variants. The interviewer went pretty deep on the math, hyperparameter choices, and serving patterns, with a pivot toward RLHF interaction at the end. Felt more like a paper review session than a standard ML interview.

Questions Asked (8)

Q1

Walk me through LoRA mathematically. What exactly is being trained and what is frozen?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

This one I actually felt okay about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining LoRA's core idea: approximating weight updates with low-rank matrices. Then mathematically describe the decomposition, specifying which parameters are frozen and which are trained. Finally, discuss the implications and trade-offs, such as parameter efficiency and rank selection.

Pro tip: Emphasize that LoRA doesn't just reduce parameters but also enables efficient task switching by keeping the base model frozen. Mention that the rank r is a hyperparameter that controls the expressiveness vs. efficiency trade-off.

1. Motivation and Intuition

Explain why LoRA is needed: full fine-tuning updates all parameters, which is expensive. LoRA hypothesizes that weight updates have low intrinsic rank.

2. Mathematical Formulation

For a pre-trained weight matrix W0 ∈ R^{d×k}, LoRA represents the update as ΔW = BA, where B ∈ R^{d×r}, A ∈ R^{r×k}, and r << min(d,k). The forward pass becomes h = W0 x + BA x.

3. Training and Freezing

W0 is frozen and not updated. Only A and B are trained. Typically, A is initialized with random Gaussian and B with zeros, so ΔW = 0 at start.

4. Scaling and Inference

A scaling factor α/r is applied to ΔW to control the magnitude. At inference, the update can be merged into W0: W = W0 + BA, eliminating extra latency.

5. Trade-offs and Practical Considerations

Discuss rank selection, parameter count (r*(d+k) vs d*k), and how LoRA compares to other PEFT methods. Mention that multiple LoRA adapters can be swapped for different tasks.

Key Points to Mention

  • Low-rank decomposition: ΔW = BA with rank r << min(d,k)
  • Frozen pre-trained weights W0; only A and B are trainable
  • Initialization: A ~ N(0, σ²), B = 0 to ensure ΔW = 0 at start
  • Scaling factor α/r to balance learning
  • Parameter efficiency: trainable parameters reduced from d*k to r*(d+k)
  • Merging at inference: W = W0 + BA, no additional latency

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

Q2

How do you choose rank r in practice, and what role does the alpha scaling factor play?

Technical Trade-offs
Author's notes

Knew the standard defaults (r in 8/16/32, alpha roughly double the rank) but fumbled explaining why sub-1x scaling sometimes wins at high rank.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that rank r and alpha are hyperparameters typically used in low-rank adaptation (LoRA) or similar parameter-efficient fine-tuning methods. Explain that r controls the capacity of the low-rank update, while alpha scales its magnitude, and that they are often tuned together. Emphasize a practical, iterative approach: begin with common defaults, then use validation performance and computational constraints to guide adjustments.

Pro tip: Mention that alpha is often set as a multiple of r (e.g., alpha = 2*r) to keep the effective learning rate stable when r changes, but always validate empirically because the optimal ratio depends on the task and model. This shows you understand the interplay and avoid blind heuristics.

1. Define the roles

Clearly state that r determines the rank of the low-rank matrices, controlling expressiveness, while alpha scales the output of the low-rank update, balancing its contribution with the original weights.

2. Start with defaults

Begin with commonly used values from literature or practice (e.g., r=8 or 16, alpha=16 or 32) as a baseline, noting that these often work well for many tasks.

3. Tune based on validation

Use a validation set to evaluate performance across a grid of r and alpha values, considering the trade-off between model capacity and overfitting, and the computational budget.

4. Consider scaling relationship

Explain that alpha is often scaled with r (e.g., alpha = 2*r) to maintain a consistent effective learning rate, but this is heuristic and should be validated.

5. Iterate and finalize

Select the smallest r that achieves satisfactory performance to minimize compute, and adjust alpha to fine-tune the update's impact, ensuring robust generalization.

Key Points to Mention

  • Rank r controls the number of trainable parameters and the expressiveness of the low-rank update.
  • Alpha scales the low-rank update, affecting the effective learning rate and the balance with pretrained weights.
  • Common practice: set alpha as a multiple of r (e.g., 2x) to stabilize training when r changes.
  • Trade-off: higher r increases capacity but risks overfitting and raises computational cost.
  • Empirical tuning: use validation performance to guide the choice of r and alpha.
  • Computational constraints: consider memory and latency requirements when selecting r.

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

Q3

Compare QLoRA and DoRA. What does each one change, and when would you pick one over the other?

Technical Trade-offsSystem Design
Author's notes

QLoRA I had cold: 4-bit quantized base weights, adapters stay in bf16, big memory savings at the cost of slower wall-clock training.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core mechanism of each method: QLoRA quantizes the base model to 4-bit and adds low-rank adapters, while DoRA decomposes weights into magnitude and direction and applies LoRA to the direction. Then compare their trade-offs in memory, compute, accuracy, and implementation complexity, and conclude with concrete scenarios where each is preferable, tying back to Amazon-scale deployment constraints.

Pro tip: Emphasize that DoRA often yields better accuracy at the same rank but adds a small overhead, so the choice hinges on whether you're memory-bound or accuracy-bound; mention that QLoRA is more mature and widely supported in frameworks like Hugging Face PEFT, which matters for production velocity.

1. Define QLoRA

Explain that QLoRA quantizes the pretrained model to 4-bit (NF4) and freezes it, then trains low-rank adapters (LoRA) in higher precision. Highlight that it drastically reduces memory, enabling fine-tuning of large models on a single GPU.

2. Define DoRA

Explain that DoRA decomposes each weight matrix into a magnitude vector and a direction matrix, then applies LoRA only to the direction while training the magnitude separately. This mimics full fine-tuning more closely and often improves accuracy over LoRA/QLoRA at the same rank.

3. Compare trade-offs

Contrast memory usage (QLoRA lower due to 4-bit base), compute overhead (DoRA slightly higher due to decomposition), accuracy (DoRA often better, especially at low ranks), and implementation complexity (QLoRA more mature and supported).

4. Match to scenarios

Recommend QLoRA when memory is the bottleneck and you need to fine-tune very large models on limited hardware, or when framework support and speed of iteration are critical. Recommend DoRA when accuracy is paramount and you can afford slightly more compute, or when you want to close the gap to full fine-tuning with minimal rank.

5. Conclude with Amazon context

Tie back to Amazon’s scale: QLoRA for cost-effective, large-scale experimentation; DoRA for high-stakes tasks where marginal accuracy gains justify extra cost. Mention that both can be combined (e.g., QDoRA) for further gains.

Key Points to Mention

  • QLoRA uses 4-bit quantization (NF4) and LoRA adapters; DoRA decomposes weights into magnitude and direction, applying LoRA to direction.
  • Memory: QLoRA reduces base model memory by ~4x; DoRA adds a small overhead for magnitude parameters.
  • Accuracy: DoRA often outperforms LoRA/QLoRA at low ranks, approaching full fine-tuning performance.
  • Compute: DoRA has slightly higher training cost due to decomposition and additional operations.
  • Ecosystem: QLoRA is widely supported (Hugging Face PEFT, bitsandbytes); DoRA is newer but gaining traction.
  • Use cases: QLoRA for memory-constrained, large-scale fine-tuning; DoRA for accuracy-critical tasks with moderate resources.

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

Q4

What is AdaLoRA and how does it differ from standard LoRA in terms of rank allocation?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Gave a decent answer about SVD-based importance scoring and per-layer rank scheduling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining AdaLoRA and its core innovation: adaptive rank allocation via singular value decomposition. Then contrast it with standard LoRA's fixed-rank approach, emphasizing how AdaLoRA dynamically prunes and reallocates rank based on importance scores. Conclude with practical implications for parameter efficiency and performance.

Pro tip: Highlight that AdaLoRA's importance-aware rank allocation often leads to better performance with fewer parameters, but mention the trade-off of increased computational overhead during training. This shows you understand both benefits and limitations.

1. Define AdaLoRA

Explain that AdaLoRA (Adaptive Low-Rank Adaptation) is a parameter-efficient fine-tuning method that adaptively allocates rank to different weight matrices based on their importance.

2. Explain Standard LoRA

Describe standard LoRA as using a fixed low rank for all weight matrices, which is simple but may be suboptimal because different layers or modules have varying importance.

3. Contrast Rank Allocation

Detail how AdaLoRA uses singular value decomposition (SVD) to parameterize the low-rank updates and employs an importance metric to prune less important singular values, effectively reallocating rank.

4. Discuss Trade-offs

Mention that AdaLoRA can achieve better performance with fewer parameters but introduces additional computational cost and complexity during training compared to standard LoRA.

5. Conclude with Impact

Summarize that AdaLoRA's adaptive rank allocation makes it more flexible and efficient for fine-tuning large models, especially when parameter budget is tight.

Key Points to Mention

  • AdaLoRA stands for Adaptive Low-Rank Adaptation.
  • Standard LoRA uses a fixed rank for all weight matrices.
  • AdaLoRA dynamically allocates rank based on importance scores.
  • It uses SVD-based parameterization to prune singular values.
  • Importance metric often based on sensitivity or gradient information.
  • Trade-off: improved parameter efficiency vs. increased training overhead.

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

Q5

When does LoRA underperform full fine-tuning? What are the failure modes?

Technical Trade-offsRoot Cause Analysis
Author's notes

This was the question I was most prepared for and I think I landed it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining LoRA and its assumptions, then systematically discuss scenarios where those assumptions break down, categorizing failure modes into optimization, capacity, and task-specific issues. Conclude with practical implications and potential mitigations.

Pro tip: Emphasize that LoRA's performance gap often stems from its low-rank constraint and limited parameter update, but also highlight that with proper rank and target module selection, LoRA can match full fine-tuning in many cases—showing nuanced understanding.

1. Define LoRA and its core assumptions

Briefly explain LoRA: it injects trainable low-rank matrices into existing weights, assuming updates lie in a low-rank subspace. This sets the stage for identifying when this assumption fails.

2. Identify optimization challenges

Discuss how LoRA may underperform due to optimization difficulties: limited parameter updates can lead to slower convergence, suboptimal minima, and sensitivity to learning rate and initialization.

3. Discuss capacity limitations

Explain that the low-rank constraint restricts the model's ability to capture complex, high-rank updates needed for certain tasks, especially when the task requires substantial deviation from the pretrained weights.

4. Cover task-specific and data-specific factors

Mention scenarios like domain shift, small datasets, or tasks requiring new reasoning skills where LoRA may not suffice. Also note that LoRA can underperform when the target modules are not well-chosen.

5. Summarize failure modes and mitigations

Conclude by listing key failure modes (e.g., underfitting, catastrophic forgetting, poor generalization) and suggest mitigations like increasing rank, targeting more modules, or combining with other methods.

Key Points to Mention

  • Low-rank constraint limits expressiveness for high-rank updates
  • Optimization challenges: slower convergence, sensitivity to hyperparameters
  • Task complexity and domain shift requiring substantial adaptation
  • Choice of target modules and rank selection impact performance
  • Data scarcity or distribution mismatch exacerbates underperformance
  • Mitigations: increase rank, target more layers, use adapters, or full fine-tuning when necessary

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

Q6

How does LoRA interact with the multi-tenant serving pattern? How would you manage multiple adapters in production?

System DesignTechnical Trade-offs
Author's notes

This is apparently a big deal at Amazon scale and I was glad I'd thought about it beforehand.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how LoRA adapters enable parameter-efficient fine-tuning, then discuss how they can be served in a multi-tenant environment by sharing the base model and dynamically loading adapters. Finally, outline production considerations such as adapter management, routing, and resource optimization.

Pro tip: Emphasize the trade-offs between latency, throughput, and isolation when serving multiple adapters, and mention techniques like adapter caching and batching to optimize performance.

1. Explain LoRA and Multi-Tenant Serving

Briefly describe LoRA as a method to fine-tune large models with small adapter modules, and multi-tenant serving as serving multiple customers from shared infrastructure.

2. Architecture for Serving LoRA Adapters

Describe how to serve a base model with multiple LoRA adapters, such as using a model server that can load and unload adapters on demand, or keeping frequently used adapters in memory.

3. Adapter Management and Routing

Discuss how to manage adapters: versioning, storage, and routing requests to the correct adapter based on tenant ID. Mention the need for a registry and dynamic loading.

4. Performance and Resource Optimization

Address batching requests across tenants, caching adapters, and using techniques like adapter fusion or quantization to reduce memory and compute overhead.

5. Trade-offs and Challenges

Discuss trade-offs: latency vs. throughput, isolation vs. resource sharing, and challenges like adapter switching overhead and cold starts.

Key Points to Mention

  • LoRA adapters are small and can be swapped at inference time without reloading the base model.
  • Multi-tenant serving requires efficient adapter management, including caching and eviction policies.
  • Request routing must map tenants to their specific adapters, possibly using a metadata store.
  • Batching across tenants can improve throughput but may increase latency and complicate isolation.
  • Adapter versioning and rollback strategies are important for production reliability.
  • Consider security and isolation: ensure one tenant's adapter doesn't affect others.

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

Q7

How do LoRA adapters behave during RLHF or PPO training? Are they frozen or updated?

Technical Trade-offsAdaptability & Ambiguity
Author's notes

Pivot question I was warned about but still half-blanked on.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that LoRA adapters are typically trainable parameters during RLHF/PPO, while the base model remains frozen. Explain how gradients flow through the adapters and discuss practical considerations like memory and stability.

Pro tip: Emphasize that LoRA's low-rank structure reduces the number of trainable parameters, which can mitigate catastrophic forgetting and make PPO more stable, but be aware of potential scaling issues with the KL penalty.

1. Define LoRA and RLHF context

Briefly explain LoRA as a parameter-efficient fine-tuning method and RLHF/PPO as a reinforcement learning approach for aligning language models.

2. State the update behavior

Clearly state that LoRA adapters are updated (trainable) during PPO, while the base model weights are frozen.

3. Explain the mechanics

Describe how gradients are computed only for the LoRA parameters, and how the forward pass combines base and adapter outputs.

4. Discuss implications

Cover benefits like reduced memory and compute, and challenges like potential underfitting or interaction with the KL divergence term.

5. Conclude with best practices

Mention that LoRA is often used with RLHF to efficiently adapt large models, and note any hyperparameter tuning needed (e.g., rank, alpha).

Key Points to Mention

  • LoRA adapters are trainable; base model is frozen.
  • Gradients flow only through LoRA parameters, reducing memory footprint.
  • PPO updates the policy (including LoRA) using reward signals and KL penalty.
  • LoRA can help mitigate catastrophic forgetting during RLHF.
  • Hyperparameters like rank and scaling factor affect performance.
  • Potential need to adjust KL coefficient when using LoRA due to changed policy capacity.

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

Q8

Which target modules should you apply LoRA to, and how does that choice affect quality versus cost?

Technical Trade-offsSystem Design
Author's notes

Knew the cheap baseline is q_proj and v_proj.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the role of different modules in a transformer and how LoRA modifies them, then discuss the trade-offs between applying LoRA to attention vs. feed-forward layers, and finally recommend a strategy based on task and resource constraints. Emphasize empirical evaluation and the importance of balancing quality and cost.

Pro tip: Mention that while attention-only LoRA is common, including feed-forward layers can yield better quality for complex tasks, but at higher memory and compute cost; always benchmark on a validation set to find the sweet spot.

1. Understand LoRA and target modules

Explain that LoRA injects low-rank matrices into specific weight matrices of a pre-trained model, typically in attention layers (query, key, value, output) and feed-forward layers. Clarify that the choice of which modules to adapt affects the number of trainable parameters and thus cost.

2. Analyze quality impact

Discuss how adapting more modules (e.g., all attention and feed-forward) can improve model capacity and performance on complex tasks, but may lead to overfitting if data is limited. Attention-only LoRA often suffices for many tasks, but feed-forward adaptation can capture richer transformations.

3. Evaluate cost implications

Quantify cost in terms of trainable parameters, memory footprint, and training time. More target modules increase these costs. Also consider inference cost: LoRA adds minimal overhead, but merging weights can affect latency.

4. Consider task and resource constraints

Tailor the choice to the specific task (e.g., generation vs. classification) and available compute. For resource-constrained scenarios, start with attention-only; for high-stakes tasks with ample resources, include feed-forward layers.

5. Recommend and justify

Provide a concrete recommendation, such as applying LoRA to all attention and feed-forward layers for maximum quality if budget allows, or only to query and value for efficiency. Emphasize the need for empirical validation to find the optimal trade-off.

Key Points to Mention

  • LoRA targets specific weight matrices; common choices are query, key, value, output projections, and feed-forward layers.
  • Quality: More modules can increase model capacity but may overfit; attention-only often sufficient for simple tasks.
  • Cost: Number of trainable parameters, GPU memory, and training time scale with number of target modules.
  • Inference: LoRA adds negligible latency, but merging weights can impact deployment.
  • Empirical trade-off: Always run ablation studies to measure quality vs. cost for your specific task.
  • Amazon context: Consider scalability and cost-efficiency, aligning with Amazon's leadership principles like frugality.

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