Concepts · Level 4 · Note 14

LoRA, differential privacy and conformal prediction: what they promise

LoRA, differential privacy and conformal prediction in plain words, then what each promise does and doesn't cover, with the research and a list of checks.

12 min read

Short answer

LoRA fine-tunes a huge model by training a small add-on file. That made custom models cheap, and removing safety training too: one study did it for under $200 on one GPU. Differential privacy adds noise in training so no single record changes the result much, but the claim means little until you know the privacy budget, epsilon. Conformal prediction gives a shortlist of answers with a stated hit rate that holds only while real inputs come from the same source as the calibration data. Treat adapters like code, ask for epsilon, and don't rely on statistics against someone who picks the inputs.

Three ideas come up whenever a team customizes a model and then has to vouch for it. LoRA is how the customizing is done cheaply. Differential privacy and conformal prediction are two kinds of mathematical promise people cite afterward. Each one is useful, and each gets described online in ways the original papers don’t support.

LoRA, in plain words

You have a 1,000-page textbook and want to adapt it for your own class. Rewriting every page is expensive. So you leave the book alone and clip a thin stack of sticky notes onto it with your corrections.

The sticky notes are LoRA. They’re tiny compared with the book, cheap to write, and easy to hand to someone else who owns the same book. Unlike sticky notes, you can’t read an adapter to see what it changes.

Animated: training a small add-on, not the whole model

Original model (frozen)
Add-on
Size of the full model
Size of the adapter
original + add-on = customized modela stranger's add-on changes your model too
  1. A model's knowledge sits in huge tables of numbers. Retraining all of them is slow and costly.
  2. LoRA freezes the original and adds two thin tables beside it.
  3. Training changes only the thin tables. The original is never touched.
  4. So what you save and share is tiny. In the paper's example, 35MB against a 350GB model.
  5. Used together, original plus add-on behaves like a customized model. The add-on can also be merged in.
  6. The same cheapness works for anyone. A small file from a stranger can change how your model behaves, and one study removed safety training for under $200.
Our animation of LoRA (Hu et al., Microsoft, 2021). File sizes are the paper's GPT-3 example.

LoRA, technically

A model’s knowledge is stored in large tables of numbers called weight matrices. Full fine-tuning changes all of them. LoRA, from a 2021 Microsoft paper, “freezes the pre-trained model weights and injects trainable rank decomposition matrices”. In the paper’s notation the new weights are W0 + BA, where W0 is the untouched original and B and A are two thin matrices that are the only things trained. B starts at zero, so training begins from the unchanged model.

Since only B and A are saved, the file is small. The paper’s example is GPT-3: the checkpoint “is reduced by roughly 10,000× (from 350GB to 35MB)”. The same paper says LoRA “can reduce the number of trainable parameters by 10,000 times” compared with full fine-tuning of that model. When you’re done, the add-on can be merged back into the base weights.

QLoRA, from the University of Washington in 2023, adds one more saving. It stores the frozen base model at lower precision, 4 bits per number, and trains the adapter through it. That was enough to “finetune a 65B parameter model on a single 48GB GPU”, cutting memory “from >780GB of GPU memory to <48GB”. This is where “fine-tune a 70B model on a single GPU” comes from.

Why LoRA is a security issue

Safety training comes off as cheaply as anything else goes on. A 2023 paper titled “LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B” reports doing exactly that “with a budget of less than $200 and using only one GPU”. Afterward the 70B model refused “about 1%” of harmful requests on two benchmarks while keeping its general ability. Hosted models were shown to be exposed through their fine-tuning services too: a Princeton-led team broke GPT-3.5 Turbo’s safety behavior by “fine-tuning it on only 10 such examples at a cost of less than $0.20”. They disclosed it to OpenAI before publishing.

An adapter is someone else’s changes to your model. Adapters are shared on public model hubs. A study first posted in February 2024 by researchers at Rice University and Samsung (version 1 of arXiv 2403.00108) trained a backdoored adapter, one with a hidden behavior planted in it. With it loaded, the share of answers mentioning a planted brand name “increased from 0% to 85%”, and the paper shows the backdoor carrying over when the adapter is merged with ordinary ones. The attacker needs no special position: “the attacker can upload it just like any other regular end-user.” These were controlled experiments on Llama 2 models. The paper has since been revised under a new title, LoRATK, with newer models.

The file format can run code. Many model files use Python’s pickle format. Hugging Face’s own documentation warns: “There are dangerous arbitrary code execution attacks that can be perpetrated when you load a pickle file.” In February 2024 JFrog reported “around 100 instances” of models on Hugging Face carrying such payloads, including one that opened a reverse shell to an outside server, a connection that lets that server run commands on the victim’s machine. JFrog adds that most of these were “attempts by researchers and/or bug bounty” hunters. The safer format is safetensors, which is built so that loading a file doesn’t run code. It does nothing about what the weights were trained to do. An external security audit of it found “no critical security flaw leading to arbitrary code execution”.

How cheap it has become

35MBadapter file, against a 350GB modelLoRA paper, GPT-3 example
<$200to remove safety training from a 70B open modelone GPU, 2023
10examples to break a hosted model's safety through fine-tuningunder $0.20, GPT-3.5 Turbo, 2023
Sources: Hu et al. 2021; Lermen, Rogers-Smith and Ladish 2023; Qi et al. 2023.

Differential privacy, in plain words

A teacher wants to publish the class average on a test without revealing any one student’s mark. If the published number would come out about the same whether or not your paper was in the pile, it tells nobody much more about your mark than they could have guessed without it. To make that true, a little random noise is added before publishing.

Differential privacy promises that the result looks about the same with or without any one record. Whether a record means one row or one person is a choice the builder makes, and it matters.

Animated: one training step with differential privacy

How hard each training example wants to pull the model

Example 1
Example 2
Example 3: a rare, personal record
Example 4
cap on every pull+ random noisemodel updated
Privacy budget spent (epsilon)
  1. Each training example pulls the model in its own direction. An unusual record can pull harder than the rest, which is one way it ends up memorized.
  2. Step one: clip. Any pull larger than the cap is cut down to the cap, so no single record can dominate.
  3. Step two: add random noise to the total. Now the result looks about the same whether or not any one record was there. How close depends on how much noise.
  4. The model learns from the noisy total. It picks up the general pattern with far less trace of any one record.
  5. Every step spends a little privacy. The running total is a number called epsilon.
  6. Smaller epsilon means stronger privacy. A big one means weak protection, so "we use differential privacy" tells you little until you hear the number.
Our animation of DP-SGD (Abadi et al., Google, 2016). Bar lengths are for illustration. Guidance on epsilon is from NIST SP 800-226.

Differential privacy, technically

The US standards body NIST states the promise this way in its 2025 guidelines: “the chance of any outcome is about the same, whether or not the individual contributes their data”.

For training models, the standard method is DP-SGD, from a 2016 Google paper. Normal training nudges the model a little for each batch of examples. DP-SGD changes two things. It works out the nudge for each example separately and clips it to a maximum size, so no single example can pull hard. Then it adds random noise to the total. A running tally, which the paper calls the moments accountant, tracks how much privacy has been spent.

That spend is a number called epsilon. Smaller is stronger. NIST says an epsilon of 0.1 “generally provides strong privacy protection”, values under 1 are “considered to be reasonable”, and “ε of 10 or greater can leave outliers vulnerable”. It gives no rule for picking one: “How to set ε is still an active area of research.”

Privacy costs accuracy. In the 2016 paper, image-recognition accuracy on the CIFAR-10 dataset was 67%, 70% and 73% at epsilon 2, 4 and 8, against about 80% for the same network trained with no privacy protection.

Why “proof it hasn’t memorized anyone’s data” overstates it

Memorization is real. In 2021 a team pulled 604 memorized training examples out of GPT-2, including “names, phone numbers, and email addresses”. In 2023 some of the same researchers did it to ChatGPT: “using only $200 USD worth of queries” they extracted over 10,000 unique memorized examples, and 16.9% of the outputs they tested contained memorized personal information. They reported it to OpenAI 90 days before publishing. In their own write-up they say that blocking the trick prompt would be “just a patch to the exploit, not a fix for the vulnerability.”

Differential privacy is the main defense with mathematics behind it. But read what NIST says it does not do:

  • “Differential privacy does not necessarily prevent somebody from making inferences about an individual.”
  • “Large values of ε may not provide meaningful privacy.”
  • The unit matters. Protecting one record at a time, which NIST calls event-level privacy, “can result in surprisingly weak privacy guarantees” when one person has many records.
  • It covers the trained model, not the raw data sitting in storage. Differential privacy “does not protect data as it is collected, stored, and analyzed in raw form”.

So a vendor saying “we use differential privacy” has told you almost nothing until you know epsilon and what the unit was. And nothing in the guarantee reaches data that enters at run time. Customer records pasted into a prompt or fetched by a search step were never part of training, so the training guarantee says nothing about them. A guarantee from private fine-tuning also covers only the fine-tuning data, not what the base model memorized before. And it protects single records: text repeated across many records, such as a shared template, can still come back out. Those last three points are our own reasoning from how the method works.

Conformal prediction, in plain words

Ask a careful doctor what’s wrong and instead of one confident guess you get a shortlist: “it’s one of these three. Across all the patients I see, the right answer is on my list nine times out of ten.” A long list means the doctor is unsure. A list of one means they’re confident.

Conformal prediction makes a model answer that way, with the hit rate backed by statistics.

Animated: from one answer to a shortlist you can count on

1,000 practice questions the model never sawbar set so the list is right 9 times in 10

Answer A
Answer B
Answer C
  1. First the model is tested on questions it never saw in training, typically 500 to 1,000 of them.
  2. From how wrong it was, a bar is set so that the shortlist contains the right answer at a chosen rate, for example 9 times in 10.
  3. An easy question: only one answer clears the bar. A list of one means the model is confident, though a short list can still be wrong.
  4. A hard question: three answers clear it. A long list is the model telling you it is unsure, which is a good moment to hand over to a person.
  5. Now a question an attacker crafted. It may look ordinary, but it was chosen, not drawn the way the practice questions were. The promise was only ever about questions drawn that way.
  6. So it is a good tool for knowing when to ask a human. It is not a guarantee against someone who chooses the inputs.
Our animation of conformal prediction (Angelopoulos and Bates). Bar lengths are for illustration.

Conformal prediction, technically

Following the standard introduction by Angelopoulos and Bates: set aside some examples the model never saw in training, for example 500 to 1,000, as a calibration set. Measure how wrong the model is on each. Use those measurements to set a threshold. For any new input, return every answer that falls within the threshold.

The resulting sets are “guaranteed to contain the ground truth with a user-specified probability, such as 90%.” This works “no matter what (possibly incorrect) model is used”. A weak model simply produces longer lists.

Two conditions carry the weight. The guarantee is an average over many inputs, which the paper calls marginal coverage, so it says nothing about any one case. It is also an average over which calibration examples you happened to draw, so one system’s real rate sits a little above or below the target. And it assumes new inputs come from the same source as the calibration examples.

The idea has been adapted to language models by a team at MIT and Google: keep sampling answers until the set will “provably contain at least one acceptable response with high probability”.

Why a statistical guarantee is not a security guarantee

The slide version is “a mathematical guarantee you can trust”. The guarantee is real. Its assumption is the problem, because an attacker chooses inputs instead of drawing them from the same source as your calibration data, and a chosen input can look perfectly ordinary.

The language-model paper says so in its stated assumptions: the promise does not cover multi-turn chats where each prompt depends on the last, or cases “when there is distribution shift between calibration and testing.” A 2024 paper from King’s College London states the general result in one line: “this guarantee is violated when the data is subjected to adversarial attacks.”

Used for what it is, conformal prediction is valuable in security work. A classifier that returns “safe”, “unsafe” or both is telling you when to send a case to a person. Just don’t write “90% guaranteed” in a risk assessment for a system that strangers can type into.

Three promises and where each one stops

LoRAPromises a cheap, small way to customize a model
stops at: who made the adapter
Differential privacyPromises one training record barely changes the model
stops at: epsilon, unit, run-time data
Conformal predictionPromises the answer set contains the truth at a stated rate
stops at: inputs unlike calibration
Our summary of the limits stated in the LoRA, NIST SP 800-226 and conformal prediction sources below.

What to check, with an example

A hospital group fine-tunes an open model on its own clinical notes and wants to tell patients it is private and reliable.

  1. Where did every file come from? For the base model and each adapter, record the publisher, the version and the hash (a fingerprint of the file). Prefer safetensors. Hugging Face’s scanner helps but its own docs say “this is not 100% foolproof.”
  2. Re-test safety after fine-tuning. The Princeton-led paper found that even harmless training data weakened safety behavior. The base model’s safety results don’t carry over to your version.
  3. Control who can fine-tune and who can upload adapters. In an organization that is a privileged action, like deploying code.
  4. If privacy is claimed, write down epsilon (with delta, its companion number) and the unit. Per record or per patient? What value? If nobody can answer, the claim is marketing.
  5. Test for memorization directly. Plant a few unique made-up records in the training data and try to extract them afterward. Failing to extract them shows only that your attempt failed, so treat a clean result as weak evidence.
  6. Protect the raw notes separately. Differential privacy on the model does nothing for the training files, the prompts or the search index.
  7. Use prediction sets as a routing signal. When the set is large, send the case to a human. A short list can still be wrong. Recalibrate when the kind of input changes, and never treat the coverage number as holding against deliberate manipulation.

The first three items are supply chain work. We’ve covered what that looks like when it goes wrong in the agent-framework PyPI compromise, where the poisoned file came from the real publisher.


Sources (all checked 23 November 2026)

  • Hu et al. (Microsoft), “LoRA: Low-Rank Adaptation of Large Language Models”, 2021: arxiv.org/abs/2106.09685
  • Dettmers, Pagnoni, Holtzman, Zettlemoyer (University of Washington), “QLoRA: Efficient Finetuning of Quantized LLMs”, 2023: arxiv.org/abs/2305.14314
  • Lermen, Rogers-Smith, Ladish, “LoRA Fine-tuning Efficiently Undoes Safety Training in Llama 2-Chat 70B”, 2023: arxiv.org/abs/2310.20624
  • Qi et al., “Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!”, 2023: arxiv.org/abs/2310.03693
  • Liu et al. (Rice University, Samsung Electronics America), “LoRA-as-an-Attack! Piercing LLM Safety Under The Share-and-Play Scenario”, version 1, February 2024, since revised as “LoRATK”: arxiv.org/abs/2403.00108v1
  • Hugging Face Hub documentation, “Pickle Scanning”: huggingface.co, and “Audit shows that safetensors is safe and ready to become the default”, 23 May 2023: huggingface.co/blog
  • JFrog Security Research, “Data Scientists Targeted by Malicious Hugging Face ML Models with Silent Backdoor”, 27 February 2024: jfrog.com
  • Abadi et al. (Google), “Deep Learning with Differential Privacy”, 2016: arxiv.org/abs/1607.00133
  • NIST SP 800-226, “Guidelines for Evaluating Differential Privacy Guarantees”, March 2025: csrc.nist.gov
  • Carlini et al., “Extracting Training Data from Large Language Models”, 2021: arxiv.org/abs/2012.07805
  • Nasr, Carlini et al., “Scalable Extraction of Training Data from (Production) Language Models”, 2023: arxiv.org/abs/2311.17035 and the authors’ write-up: not-just-memorization.github.io
  • Angelopoulos, Bates, “A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification”, 2021: arxiv.org/abs/2107.07511
  • Quach et al. (MIT, Google Research), “Conformal Language Modeling”, 2023: arxiv.org/abs/2306.10193
  • Jeary, Hosseini, Kuipers, Paoletti (King’s College London), conformal prediction under adversarial attacks, 2024: arxiv.org/abs/2405.18942