Slides · Fine-tuning
Fine-tuning: interview drills
1 / 34
Fine-tuning: interview drills
Turning the module into spoken answers: a ninety-second opener, sizing arithmetic, a loss by hand, a forty-minute program design and symptom diagnosis.
By the end you can state the opener with its break-even, work memory, parameter and time estimates while naming what each leaves out, read a DPO loss, structure a design answer, and name likely causes in order with the first check.
Concept
How to use these drills
- Answer aloud, under a clock, before opening the key. Reading a drill teaches little.
- Provenance: each drill slide carries its own label, Common industry pattern or Generated practice. None is verified as asked by a named company, and this deck makes no such claim.
- Every figure in the drills is invented for the exercise. Every calculation was recomputed with a script. The code slide holds the LoRA, ZeRO and time estimators with their test results.
- Sizes are decimal GB. Every memory figure is a floor that leaves out activations, logits and framework overhead.
- Library behaviour quoted here is as read in the docs on 24 and 25 October 2026. If your interview uses a newer version, say which version you last read.
Diagram
The order of a strong answer
Every answer, from ninety seconds to forty minutes, follows these five moves in this order.
Worked example
The ninety-second opener, with its evidence
Provenance: Generated practice.
“I start by naming what failed. Stale or missing facts go to retrieval. Wrong behaviour goes to a stronger prompt and examples. Cost or latency goes to caching or a smaller model. A tune enters only if those fall short, and it has to beat the best option I could ship, on the newest base model, on held-out data. Then I price it: one-off cost over the daily saving after hosting, tested against the cheapest alternative. If it still pays, I begin with a small LoRA run, size memory and time from stated assumptions, gate the result with slices and base-versus-tuned suites, ship behind a canary with a rollback pointer, and re-decide when the base model changes.”
| Number or claim you may say | Where it comes from |
|---|---|
| 16 bytes per parameter for Adam in mixed precision | The ZeRO paper adds 2 bytes of weights, 2 of gradients and an optimiser multiplier of 12 |
| About 6 operations per parameter per training token | The scaling-laws paper takes the backward pass as about twice the forward pass |
| A LoRA adapter starts as a no-op | The LoRA paper initialises one factor at random and the other at zero, so the update starts at zero |
Sources[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models[2] Scaling Laws for Neural Language Models[3] LoRA: Low-Rank Adaptation of Large Language Models
Compare
Match the failure to the cheapest fix
Provenance: Generated practice.
| What is failing | First thing to try | What a tune would still cost |
|---|---|---|
| The answer needs facts that change weekly | Retrieval or a tool call | Retraining every time the facts move |
| The format or tone is off | A sharper prompt with examples | Data, a run, a gate and upkeep |
| The bill or latency is too high | Prompt caching, a smaller model | A project that must beat the cached baseline |
| A narrow skill fails at high volume after prompting | A small LoRA run | The full program, from baseline to rollback |
This table is course advice. Say the row that fits your case, then the cost in the last column.
Check yourself
Check: critique this opener
Provenance: Generated practice.
A candidate answers: “Fine-tuning is the professional approach and LoRA makes it cheap, so I would fine-tune the biggest model we can afford and measure afterwards.” Using the five-move order, what is missing, and how would you repair the first two sentences?
Answer
It starts at the method. There is no failure named (move 1), no cheaper fix considered (move 2), no price against a baseline (move 3), and measuring afterwards leaves no way to know (move 4). A repair: “First I would ask what is failing: missing facts, wrong behaviour or cost. I would measure the best prompt with caching on, and only if a gap remains would I price a small LoRA run against it.”
Worked example
Worked: one project, two baselines
Provenance: Generated practice.
Illustrative: a tune costs $9,000 once and adds $150 a day to host. It would cut the daily model bill from $720 to $240. Prompt caching alone, with no project, would cut the bill to $400.
| Compared with | Daily saving after hosting | Days to break even |
|---|---|---|
| Today’s uncached bill | 720−(240+150)=330 | 9000/330=27.3 |
| Caching alone | 400−(240+150)=10 | 9000/10=900 |
The same project looks like a month’s payback against the wrong baseline and a multi-year payback against the right one. Always quote the second row.
Check yourself
Check: how long until it pays for itself?
Provenance: Generated practice.
A tune costs $15,000 once. The tuned setup costs $210 a day for the model plus $200 a day to host. Caching alone would give a bill of $520 a day. How many days to break even against caching, and what would you add to the cost side before presenting the number?
Answer
The tuned total is 210+200=410 a day, so the saving is 520−410=110 a day and the break-even is 15000/110, about 136 days. Add what the table omits: evaluation, labelling upkeep, and a re-tune when the base model changes. That is about 4.5 months of payback, so a new base model arriving a few months after launch could force a re-tune before the project has repaid.
Math
The memory formulas
full fine-tuning=16P bytesLoRA=2P+16A bytesQLoRA=0.5P+16A+80.127P bytesZeRO per GPU (stages 0 to 3)=16P 4P+N12P 2P+N14P N16Padapter size A=∑r×(din+dout) over every adapted matrix| Symbol | Meaning |
|---|---|
| P | Parameters in the base model |
| A | Trainable adapter parameters; 16 bytes covers weights, gradients and Adam terms |
| N | Number of GPUs sharing the states |
| 0.127 | Bits per parameter left for quantisation constants after double quantisation, as the QLoRA paper computes for its block size |
The memory formulas are floors: activations, the logits tensor and framework overhead come on top. The adapter size A is the exact trainable-parameter count, while the bytes it costs sit inside a floor like the rest.
Sources[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models[4] QLoRA: Efficient Finetuning of Quantized LLMs[3] LoRA: Low-Rank Adaptation of Large Language Models
Worked example
Worked: full fine-tuning states
Provenance: Generated practice.
| Model | Arithmetic | States |
|---|---|---|
| 1.5B | 16×1.5 | 24 GB |
| 13B | 16×13 | 208 GB |
| 70B | 16×70 | 1,120 GB |
The ZeRO paper states the same 24 GB minimum for its 1.5B-parameter example. At 80 GB a card, the 70B states alone need 14 cards (1120/80), before activations or communication buffers. Say that omission out loud.
Source[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models
Worked example
Worked: adapter parameters when shapes differ
Provenance: Generated practice.
A made-up decoder: hidden size 2,048, 16 layers, rank 32, adapters on the four attention projections. The query and output projections are 2,048 by 2,048; the key and value projections map 2,048 down to 512.
| Matrix | r×(din+dout) | Parameters |
|---|---|---|
| Query | 32×(2048+2048) | 131,072 |
| Output | 32×(2048+2048) | 131,072 |
| Key | 32×(2048+512) | 81,920 |
| Value | 32×(2048+512) | 81,920 |
| One layer | sum | 425,984 |
| 16 layers | 425984×16 | 6,815,744 |
The frozen attention weights hold 16×(2×20482+2×2048×512)=167,772,160 parameters, so the adapter is about 4.06 percent of them. Its training states at 16 bytes each are about 0.109 GB.
Source[3] LoRA: Low-Rank Adaptation of Large Language Models
Check yourself
Check: pick the rank from a budget
Provenance: Generated practice.
A decoder has hidden size 4,096 and 32 layers, with adapters on four square attention projections per layer. You want at most 20 million trainable parameters. What is the largest whole rank, which power-of-two rank would you actually use, and what are the adapter’s training states at that rank?
Answer
Each unit of rank costs 4×(4096+4096)×32=1,048,576 parameters, so the budget allows 20000000/1048576=19.07, a largest whole rank of 19. Rank 16 is the power-of-two choice: 16,777,216 parameters, and at 16 bytes each about 0.268 GB of states.
Worked example
Worked: QLoRA states
Provenance: Generated practice.
A 13B base in 4 bits with an adapter of 1 percent of the base (0.13B parameters).
| Part | Arithmetic | GB |
|---|---|---|
| 4-bit base | 0.5×13 | 6.50 |
| Adapter states | 0.13×16 | 2.08 |
| Quantisation constants | 13×0.127/8 | 0.21 |
| Floor | sum | 8.79 |
The QLoRA paper describes dequantising each weight tensor to BFloat16 before the matrix multiply, so activations and the logits tensor keep 16-bit sizes. That is why 8.79 GB is a floor and not a prediction.
Check yourself
Check: how big a base fits?
Provenance: Generated practice.
A team has a 24 GB card and reserves 4 GB for activations and overhead. The adapter is 0.5 percent of the base. Using the QLoRA formula, what is the largest base, in billions of parameters, whose states fit the remaining 20 GB?
Answer
Per billion parameters the states cost 0.5+0.127/8+0.005×16=0.596 GB. Dividing, 20/0.596 is about 33.6, so about 33 billion parameters is the ceiling under these assumptions. The reserve is a guess: a long sequence or a large batch can need more than 4 GB, which lowers the ceiling.
Worked example
Worked: ZeRO stages for 13B on 8 GPUs
Provenance: Generated practice.
| Stage | Formula | Per GPU |
|---|---|---|
| Plain data parallel | 16×13 | 208 GB |
| ZeRO-1 | 4×13+12×13/8 | 71.5 GB |
| ZeRO-2 | 2×13+14×13/8 | 48.75 GB |
| ZeRO-3 | 16×13/8 | 26 GB |
On 48 GB cards only stage 3 fits, and stage 2 misses by 0.75 GB before any activations. The paper reports that stages 1 and 2 keep the communication volume of data parallelism, while stage 3 adds about 50 percent.
Source[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models
Check yourself
Check: when no stage is enough
Provenance: Generated practice.
A 7B model is fully tuned on 4 GPUs of 24 GB. Compute the per-GPU states for stages 0 to 3. Does any stage fit, and what are your two next moves?
Answer
Stage 0 is 112 GB, stage 1 is 4×7+12×7/4=49 GB, stage 2 is 2×7+14×7/4=38.5 GB, and stage 3 is 16×7/4=28 GB. None fits 24 GB, and these are floors. Moves: add GPUs (at 8 GPUs stage 3 needs 14 GB, but that leaves about 10 GB of a 24 GB card for activations and overhead) or switch to LoRA or QLoRA, which shrink the states at the source.
Math
Training time from first principles
full fine-tuning: FLOPs=6NDLoRA: FLOPs=4NDtime=sustained rateFLOPs| Symbol | Meaning |
|---|---|
| N | Model parameters |
| D | Training tokens, summed over epochs |
| sustained rate | FLOP/s the hardware really delivers, always below peak; an assumption you state |
The scaling-laws paper takes the backward pass as about twice the forward pass, which gives 2N + 4N per token. A course derivation, not a measurement, splits the backward 4N into 2N for input gradients and 2N for weight gradients. Frozen layers still need input gradients, so LoRA saves only the weight-gradient part and keeps 4N.
Both counts are floors. Activation checkpointing recomputes the forward pass during the backward pass, which in a course derivation adds about one more forward pass, 2N per token, giving about 8ND for full tuning and 6ND for LoRA. The TRL documentation (main branch, read 25 October 2026) shows SFTConfig and DPOConfig defaulting gradient_checkpointing to True, so a default run may pay that extra pass. Check your installed version.
Sources[2] Scaling Laws for Neural Language Models[5] SFT Trainer (TRL documentation)[6] DPO Trainer (TRL documentation)
Worked example
Worked: a 7B run
Provenance: Generated practice.
A 7B model, 120 million tokens per epoch, 2 epochs, one GPU sustaining 250 TFLOP/s.
| Step | Arithmetic | Result |
|---|---|---|
| Tokens D | 120×106×2 | 240×106 |
| Full FLOPs | 6×7×109×240×106 | 1.008×1019 |
| Full time | 1.008×1019/(250×1012) | 40,320 s, 11.2 h |
| LoRA FLOPs | 4×7×109×240×106 | 6.72×1018 |
| LoRA time | 6.72×1018/(250×1012) | 26,880 s, 7.47 h |
State what the figure ignores: any recompute from activation checkpointing, and that the 112 GB of full-tuning states cannot sit on one card, so the real run needs several GPUs and loses some efficiency to communication.
Check yourself
Check: run the formula backwards
Provenance: Generated practice.
You have a 6-hour LoRA budget on an 8B model, with a GPU sustaining 300 TFLOP/s. How many training tokens can you process, and what dataset size does that allow at 3 epochs?
Answer
The budget is 6×3600×300×1012=6.48×1018 FLOPs. LoRA costs 4×8×109=3.2×1010 FLOPs per token, so D=6.48×1018/(3.2×1010)=202.5 million tokens. At 3 epochs that is a dataset of 67.5 million tokens. This is an upper bound: lost efficiency and evaluation time reduce it.
Worked example
Worked: a DPO loss, two betas
Provenance: Generated practice.
The loss is −lnσ(β×(preferred log-ratio−rejected log-ratio)). Illustrative: preferred +1.5, rejected -0.5.
| beta | Margin | sigmoid(margin) | Loss |
|---|---|---|---|
| 0.1 | 0.2 | 0.550 | 0.598 |
| 0.7 | 1.4 | 0.802 | 0.220 |
A larger beta makes the same movement look more finished, so the pair stops pulling sooner. The loss uses only the difference of the two log-ratios: preferred -0.2 and rejected -2.2 also give a margin of 0.2 at beta 0.1, and the same loss of 0.598.
Source[7] Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Check yourself
Check: which pair has the lower loss?
Provenance: Generated practice.
At beta 0.3, pair X has a preferred log-ratio of +0.5 and a rejected log-ratio of -0.5. Pair Y has -1.0 and -2.5. Compute both losses. What does the comparison say about trusting the loss alone?
Answer
X has a margin of 0.3×1.0=0.3 and a loss of 0.554. Y has a margin of 0.3×1.5=0.45 and a loss of 0.493, so Y scores better even though its preferred answer became less likely than under the reference. A falling loss does not prove good answers are becoming more probable, so also log the absolute likelihood of the preferred answers.
Source[7] Direct Preference Optimization: Your Language Model is Secretly a Reward Model
Code
The estimators as code
Python
import math
def _positive(x):
return (isinstance(x, (int, float)) and not isinstance(x, bool)
and math.isfinite(x) and x > 0)
def _whole(x, minimum=1):
return isinstance(x, int) and not isinstance(x, bool) and x >= minimum
def lora_params(rank, shapes):
if not _whole(rank):
raise ValueError("rank must be a whole number, at least 1")
if not shapes or not all(len(s) == 2 and all(_whole(d) for d in s) for s in shapes):
raise ValueError("need (d_in, d_out) pairs of positive whole numbers")
return sum(rank * (d_in + d_out) for d_in, d_out in shapes)
def zero_gb(params_b, n_gpus, stage):
if not _positive(params_b) or not _whole(n_gpus):
raise ValueError("parameters must be positive and GPUs a whole number")
if not _whole(stage, 0) or stage > 3:
raise ValueError("stage must be 0, 1, 2 or 3")
p, n = params_b, n_gpus
if stage == 0:
return 16 * p
if stage == 1:
return 4 * p + 12 * p / n
if stage == 2:
return 2 * p + 14 * p / n
return 16 * p / n
def train_hours(params_b, tokens_m, tflops, lora=False):
if not all(_positive(v) for v in (params_b, tokens_m, tflops)):
raise ValueError("all inputs must be positive, finite numbers")
flops = (4 if lora else 6) * params_b * 1e9 * tokens_m * 1e6
return flops / (tflops * 1e12) / 3600| Test (Python 3.14.6, standard library only, 25 October 2026) | Result |
|---|---|
| Rank 32, shapes of the adapter slide, times 16 layers | 6,815,744 |
zero_gb(13, 8, s) for stages 0 to 3 | 208, 71.5, 48.75, 26.0 |
zero_gb(7, 4, s) for stages 0 to 3 | 112, 49.0, 38.5, 28.0 |
train_hours(7, 240, 250) full, then LoRA | 11.2, 7.47 |
27 bad inputs: rank 0, 2.5 or True; an empty shape list; a negative, NaN, fractional or True dimension; a three-number shape; stage 4, 1.0 or True; zero, fractional or True GPUs; zero, negative, NaN, infinite or True parameters, tokens or rate | all 27 raise ValueError as intended |
Memory inputs are billions of parameters and the result is decimal GB; token inputs are millions.
Sources[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models[3] LoRA: Low-Rank Adaptation of Large Language Models[2] Scaling Laws for Neural Language Models
Process
A forty-minute design answer, in order
Provenance: Common industry pattern.
- Clarify: success metrics, constraints such as personal data, acceptable regression, timeline, who maintains it.
- Baseline first: the best prompt with examples, caching on, priced.
- Data: label noise, personal data, deduplication, a group split, a golden set with slices.
- Method and training plan: LoRA first; memory and time with assumptions stated.
- Gate: ladder, interval, slices, regression and safety suites versus the base, pass rules written first.
- Rollout and upkeep: shadow, canary, rollback pointer, re-tune triggers.
- Alternatives and fallback: what you would do if the tune fails the gate.
A rough split (course advice) is 4 minutes on step 1, 5 on step 2, 6 on step 3, 6 on step 4, 6 on step 5, 6 on step 6, and 7 on step 7 with questions.
Worked example
Worked: do the arithmetic before the method
Provenance: Generated practice.
Prompt (all figures invented). An insurer receives 1.2 million claim emails a month. A large API model with a 700-token fixed prompt sorts each into one of 14 categories and drafts a reply. The team has 25,000 labelled emails, strict personal-data rules and one platform engineer. Should they fine-tune?
| Step | Arithmetic | Result |
|---|---|---|
| Emails per day (30-day month) | 1,200,000/30 | 40,000 |
| Fixed-prefix tokens per day | 40,000×700 | 28 million |
| Prefix cost at an assumed $1 per million | 28×1 | $28 a day |
| With cached input billed at an assumed 10 percent | 28×0.1 | $2.80 a day |
Uncached, the fixed prefix alone is about $10,000 a year (28×365), a small line next to a team. The email body and the drafted reply add tokens that this table does not price, so measure those before drawing a cost conclusion. The case, if any, must rest on quality, tone or latency that a better prompt cannot reach, and on the data being clean. Say that before naming LoRA.
Source[8] Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!
Diagram
The decision flow behind the answer
Check yourself
Check: find the gaps in this outline
Provenance: Generated practice.
A candidate outlines: “Take the 25,000 labelled emails, run LoRA on the largest model that fits, and ship it if its accuracy beats the current system.” Name the three most serious gaps in priority order and the first sentence you would say to repair the outline.
Answer
First, no baseline: the current system is not the best prompt with caching on, so the comparison is too easy. Second, no gate beyond an average: no held-out split by thread or customer, slices, interval, or base-versus-tuned regression and safety suites. Third, no rollout or upkeep: no canary, rollback pointer or re-decision when the base changes. Repair opener: “Before any training I would price the best prompt with caching on, and set the pass rules for the gate.”
Compare
Symptoms, causes in order, first check
Provenance: Generated practice.
| Symptom | Causes to walk through | First check |
|---|---|---|
| Loss stays near its starting value | Labels masked out, nothing reaches the model, learning rate far too low | Count unmasked label tokens in a decoded batch |
| Held-out loss rises from epoch 2 while training loss falls | Overfitting, duplicate rows, too many epochs | Duplicate overlap, then the best held-out checkpoint |
| One language or customer is far worse than the average | Slice hidden by the average, thin data for that slice | A slice report against the baseline |
| Fewer refusals of harmful prompts, though the data was harmless | Safety erosion from tuning | The safety suite on the tuned model versus the base |
| Replies stop mid-sentence | Length cap, end token missing from targets | Decode the end of a batch and read the length setting |
The TRL documentation says assistant_only_loss needs a chat template with generation markers (it patches the template itself for known families such as Qwen3), and that the end token must match the template so replies terminate. The causes in the table are course judgement.
Sources[5] SFT Trainer (TRL documentation)[8] Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!
Diagram
Name the symptom, then the first check
Check yourself
Check: three epochs, one good checkpoint
Provenance: Generated practice.
Held-out accuracy was 0.84 after epoch 1 and 0.81 after epoch 3, while training loss kept falling. A scan finds that about 11 percent of the rows are near-duplicates of each other. Name the likely causes in order, the first check, and two fixes.
Answer
Overfitting helped by duplicates is first. The first check is whether duplicated rows fall on both sides of the split, because duplicates also inflate the early score. Fixes: deduplicate and re-split by group, then keep the epoch-1 checkpoint or lower the epoch count or adapter rank. Re-run the base-versus-tuned suites on whichever checkpoint is kept.
Compare
Rapid-fire answers (about twenty seconds each)
Provenance: Generated practice.
| Question | Short answer |
|---|---|
| Why 16 bytes a parameter, not 2? | Gradients add 2, and Adam keeps an fp32 copy of the weights plus two moment estimates, 12 bytes |
| What do you add when you quote a memory floor? | Activations, logits and framework overhead |
| Why does a LoRA adapter start as a no-op? | One factor is zero, so the weight update begins at zero and the model equals the base |
| What does QLoRA do before a matrix multiply? | Dequantises the stored 4-bit weight tensor to BFloat16 |
| What does ZeRO-3 cost besides code? | About 50 percent more communication than data parallelism, per the paper |
What does 6ND count? | About 2 operations per parameter-token forward and 4 backward |
| What does a bigger DPO beta do? | The loss saturates sooner, so the model stays nearer the reference |
| What do you say about a library default? | The version you last read, and that it should be re-checked |
Sources[1] ZeRO: Memory Optimizations Toward Training Trillion Parameter Models[3] LoRA: Low-Rank Adaptation of Large Language Models[4] QLoRA: Efficient Finetuning of Quantized LLMs[2] Scaling Laws for Neural Language Models
Compare
A 45-minute mock plan
Provenance: Generated practice.
| Minutes | Part | Prompt idea |
|---|---|---|
| 0 to 5 | Warm-up | “Tune or retrieve for our internal docs assistant?” |
| 5 to 15 | Depth | A LoRA config to size, then “where does QLoRA’s memory go?” |
| 15 to 22 | Debug | “The tuned model regressed on general tasks.” |
| 22 to 28 | Alignment | “DPO, RLHF or GRPO for a maths tutor?” |
| 28 to 43 | Design | A program design, with the interviewer probing data, gate, rollback and cost |
| 43 to 45 | Close | “Three biggest risks, and what do you measure first?” |
The interviewer does not teach during the mock. Afterwards, note the two places you lost the thread and repeat those drills on a nearby variant a few days later.
Summary
Summary
- Open with the failure, the cheapest fix, the price against the right baseline, the proof and the upkeep. Quote break-even against caching, not against the uncached bill.
- Memory:
16Pfull,2P + 16ALoRA, about0.5P + 16Aplus constants for QLoRA, and four ZeRO formulas. All are floors. - Adapter size is r×(din+dout) per matrix, so check each matrix’s real shape.
- Time is
6NDover a sustained rate, with LoRA at4ND; both are floors. Run it backwards to size a budget. - The DPO loss depends on the difference of two log-ratios scaled by beta.
- Design in order, and diagnose by naming causes in order with the first check.
References
References & Sources (1 of 2)
ZeRO: Memory Optimizations Toward Training Trillion Parameter Models (opens in a new tab)
Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He2019Preprint
arXiv 1910.02054 (opens in a new tab)https://arxiv.org/abs/1910.02054
Used for The 2P + 2P + KP memory accounting with K = 12 for mixed-precision Adam, the 24 GB example for 1.5B parameters, the ZeRO stage formulas, and the 1.5 times communication of stage 3.
Scaling Laws for Neural Language Models (opens in a new tab)
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, et al.2020Preprint
arXiv 2001.08361 (opens in a new tab)https://arxiv.org/abs/2001.08361
Used for Training compute of about 6N operations per token, with the backward pass about twice the forward pass.
LoRA: Low-Rank Adaptation of Large Language Models (opens in a new tab)
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, et al.2022ICLR 2022Paper
arXiv 2106.09685 (opens in a new tab)https://iclr.cc/virtual/2022/poster/6319
Used for The low-rank update with one factor random and the other zero, so the update starts at zero.
QLoRA: Efficient Finetuning of Quantized LLMs (opens in a new tab)
Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke Zettlemoyer2023NeurIPS 2023Paper
arXiv 2305.14314 (opens in a new tab)https://proceedings.neurips.cc/paper_files/paper/2023/hash/1feb87871436031bdc0f2beaa62a049b-Abstract-Conference.html
Used for 4-bit storage with dequantisation to BFloat16 for the multiply, and 0.127 bits per parameter of constants after double quantisation.
SFT Trainer (TRL documentation) (opens in a new tab)
Hugging Face2026Documentation
https://huggingface.co/docs/trl/sft_trainer
Used for Read on 25 October 2026: assistant_only_loss needs a chat template with generation markers (TRL patches the template itself for known families such as Qwen3), the end token must be aligned with the chat template, and SFTConfig defaults gradient_checkpointing to True.
References
References & Sources (2 of 2)
DPO Trainer (TRL documentation) (opens in a new tab)
Hugging Face2026Documentation
https://huggingface.co/docs/trl/dpo_trainer
Used for Read on 25 October 2026 (main-branch docs): DPOConfig defaults gradient_checkpointing to True, as SFTConfig does.
Direct Preference Optimization: Your Language Model is Secretly a Reward Model (opens in a new tab)
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning, et al.2023NeurIPS 2023Paper
arXiv 2305.18290 (opens in a new tab)https://proceedings.neurips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html
Used for The DPO loss as a sigmoid of beta times the difference of two log-ratios against a reference.
Xiangyu Qi, Yi Zeng, Tinghao Xie, Pin-Yu Chen, et al.2024ICLR 2024Paper
arXiv 2310.03693 (opens in a new tab)https://proceedings.iclr.cc/paper_files/paper/2024/hash/83b7da3ed13f06c13ce82235c8eedf35-Abstract-Conference.html
Used for Fine-tuning can degrade safety alignment, including with benign datasets.
Keys: ← → move, Home End first and last, F full screen.