Scale AI interview questions
AI startup · 7 questions reported
- junior 2
- mid 3
- senior 2
These are 7 technical questions candidates reported being asked in Scale AI interviews for AI engineer, ML engineer and applied AI engineer roles, each with a model answer you can say out loud in a minute or two. They cover fine-tuning & alignment, embeddings, sampling, structured outputs, prompt injection and rag: 2 junior, 3 mid-level and 2 senior questions. Every question comes from a public interview write-up that names Scale AI.Updated
Scale AI embeddings questions
Model answer
Two endpoints, one encoder: classification is a light head on the embedding. Interactive calls are synchronous, with dynamic batching to a latency target.
Batch is an async job: submit a file, get a job id, poll or take a webhook, read results from storage, trading latency for cost. Every response names the model version, because vectors from different versions aren't comparable.
Scale AI next-token prediction and sampling questions
Model answer
Self-attention draws queries, keys and values from one sequence; cross-attention takes queries from the decoder and keys and values from another source, like an encoder's output.
Scroll sideways to see the whole diagram
The model reads the whole prompt: every position goes through all the transformer blocks.
Text version
- The model reads the whole prompt: every position goes through all the transformer blocks.
- To predict what comes next, only the vector at the last position is used.
- The LM head turns that vector into one score per vocabulary token: a logit. Higher means more likely next.
- Softmax turns the scores into probabilities. Temperature divides the scores first: below 1 sharpens the distribution, above 1 flattens it.
- One token is chosen: greedy takes the most likely; sampling draws at random, weighted by probability, optionally only among the top-k or top-p candidates.
- The chosen token is appended and the whole loop runs again. One loop per generated token, until a stop token or a length limit.
The standard autoregressive decoding loop of a GPT-style model. The vocabulary size is GPT-2's 50,257 tokens.
Decoding is a loop: score the next token, pick one greedily or by temperature and top-p, append, repeat, with a KV cache. RL then tunes those sampled outputs against a reward, held near a reference model. Evaluate with perplexity, task benchmarks and human or judge preferences.
Scale AI examples and structured outputs questions
Model answer
Template the prompt with the schema and one example, and use the API's JSON or structured-output mode if it has one. Parse the reply and validate it with Pydantic against the same schema. On failure, retry with the validation error, a few times at most, then fail loudly.
Scroll sideways to see the whole diagram
The happy path: the text parses, every field passes its check, and the value goes on to the code that needs it.
Text version
- The happy path: the text parses, every field passes its check, and the value goes on to the code that needs it.
- If parsing fails, a cheap repair may save it: strip the preamble or the code fence, add a missing brace, then check again.
- If the content is wrong (a missing field, an invented label), repair can't help. Call the model again, ideally telling it what failed.
- Cap the retries. After the last one, fall back, flag the input for a person and log the bad output: it is your best data on how outputs break.
After AI Engineering, Ch. 2, "Structured Outputs" (post-processing; test time compute: generate until an output fits). Illustrative flow.
Scale AI prompt injection and defences questions
Model answer
Use greedy coordinate gradient from Zou et al.: optimise one token suffix that makes a target completion likely across many prompts, which makes it universal. Token gradients propose swaps; exact loss picks the best.
import torch
import torch.nn.functional as F
def loss(model, E, prompt, oh, target):
# E = model.transformer.wte.weight
x = torch.cat([E[prompt], oh @ E, E[target]])
out = model(inputs_embeds=x[None]).logits[0]
n = len(target)
return F.cross_entropy(out[-n - 1:-1], target)
def gcg_step(model, prompts, suf, target,
k=64, tries=128):
model.requires_grad_(False) # grads on oh only
E = model.transformer.wte.weight
oh = F.one_hot(suf, E.shape[0]).to(E.dtype)
oh.requires_grad_()
sum(loss(model, E, p, oh, target)
for p in prompts).backward()
cand = (-oh.grad).topk(k, dim=1).indices
best, best_l = suf, float("inf")
for _ in range(tries):
s = suf.clone()
i = torch.randint(len(s), (1,)).item()
s[i] = cand[i, torch.randint(k, (1,)).item()]
with torch.no_grad():
o = F.one_hot(s, E.shape[0]).to(E.dtype)
l = sum(loss(model, E, p, o, target).item()
for p in prompts)
if l < best_l:
best, best_l = s, l
return best
Evaluate safely: a local model, a benign target string, success rate on held-out prompts, and defences like perplexity filtering.
Scale AI retrieval-augmented generation questions
Model answer
Before the model answers, retrieve relevant passages from your documents and put them in the prompt, so it answers from evidence in its context, not memory alone.
Scroll sideways to see the whole diagram
Search your own documents for passages related to the question, with keywords, embeddings or both.
Text version
- Search your own documents for passages related to the question, with keywords, embeddings or both.
- A reranker reads the question with each candidate and keeps the few that actually answer it.
- The kept passages go into the prompt, with instructions to answer only from them.
- The model answers from evidence in its context instead of memory alone, so the answer can be checked against its sources.
The pattern of Lewis et al. (2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, as used in production systems.
It cuts hallucination when retrieval finds the right passage and the prompt says to answer only from it, cite it, and admit when it isn't there.
Scale AI fine-tuning and alignment questions
Model answer
Start with what the model actually sees: decode a batch back to text. Usual suspects: a chat template that differs from the base model's; labels shifted twice or not at all; a loss not masked to the answer tokens, so the model learns to predict prompts; padding counted in the loss; new special tokens missing from the tokenizer; a learning rate too high for the batch. Then overfit ten examples: if the loss won't approach zero, the bug is in the pipeline, not the data.
Model answer
SFT imitates demonstrations: simple and stable, but can't exceed its data. RLHF trains a reward model on preferences and optimises against it with PPO: it can beat the demos, but is costly, unstable and prone to reward hacking. DPO-style methods learn from preference pairs directly: cheap and steady, but offline.
For checkable tasks like maths and code, RL with verifiable rewards, such as GRPO, skips the reward model. SFT usually comes first.
Each question comes from a public interview write-up or video that names Scale AI; the answers are ours. Not affiliated with Scale AI.