Temperature
A number that divides the logits before softmax: below 1 sharpens the distribution, above 1 flattens it, 0 means greedy.
Interview questions about Temperature
- Explain temperature, top-k and top-p. Why would you usually reach for top-p rather than a fixed k?
Temperature divides every logit by T before softmax: low T sharpens, high T flattens, and T near 0 approaches greedy.
- Your integration tests call a hosted model at temperature 0 and compare the output with an exact string. They fail now and then. What's going on, and what do you change?
The test assumes a determinism a hosted API doesn't promise. Temperature 0 is greedy and uses no random numbers, and our sampling script gave byte-identical…
- Implement masked cross-entropy in NumPy that stays numerically stable, with label smoothing and a temperature.
Work in log-probs and subtract the row max before the log-sum-exp, so nothing overflows.
- Cover the fundamentals: self- versus cross-attention, autoregressive decoding and sampling, where RL fits, and how you evaluate the result.
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…
- Build a lightweight evaluation harness for a model served through Ollama: run a dataset of prompts, score the answers against references and report the results.
Keep it small: a JSONL dataset, a client that calls Ollama's generate endpoint with temperature fixed, a scorer, and a report.
- Your judge gives the same reply different scores on different runs. What do you do?
Reduce the randomness: fix the sampling settings, such as temperature 0, and add scored examples to the prompt. Zheng et al.
- For an offline audio detection system, outline the ML inference and labeling pipeline: feature extraction, keyword spotting, thresholding, calibration and human labeling.
Decode and resample the audio, then compute log-mel spectrograms over short overlapping windows.