# 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.

- Published: 2026-11-23
- Topics: AI security, LLM security, Fine-tuning
- Canonical page: https://thesecguy.com/notes/lora-differential-privacy-conformal-prediction/
- Publisher: The Sec Guy (https://thesecguy.com)

**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.

<figure class="fig">
<p class="fig-k">The book and the sticky notes</p>
<div class="flow">
<div class="node"><b>Original model</b><span>The huge table of numbers it was trained with</span><div class="chips"><i class="chip">frozen</i><i class="chip">not changed</i></div></div>
<div class="node"><b>Add-on (the adapter)</b><span>Two thin tables, the only part that is trained</span><div class="chips"><i class="chip">small file</i><i class="chip">easy to share</i></div></div>
<div class="node"><b>Used together</b><span>Original plus add-on behaves like a customized model</span><div class="chips"><i class="chip">can be merged</i></div></div>
</div>
<figcaption>Our illustration of the design in the LoRA paper.</figcaption>
</figure>

## 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](https://arxiv.org/abs/2106.09685), "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](https://arxiv.org/abs/2305.14314), 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"](https://arxiv.org/abs/2310.20624) 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](https://arxiv.org/abs/2310.03693) 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](https://arxiv.org/abs/2403.00108v1)) 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](https://jfrog.com/blog/data-scientists-targeted-by-malicious-hugging-face-ml-models-with-silent-backdoor/) "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".

<figure class="fig">
<p class="fig-k">How cheap it has become</p>
<div class="tiles">
<div class="tile"><b>35MB</b><span>adapter file, against a 350GB model</span><small>LoRA paper, GPT-3 example</small></div>
<div class="tile hot"><b>&lt;$200</b><span>to remove safety training from a 70B open model</span><small>one GPU, 2023</small></div>
<div class="tile"><b>10</b><span>examples to break a hosted model's safety through fine-tuning</span><small>under $0.20, GPT-3.5 Turbo, 2023</small></div>
</div>
<figcaption>Sources: Hu et al. 2021; Lermen, Rogers-Smith and Ladish 2023; Qi et al. 2023.</figcaption>
</figure>

## 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.

<figure class="fig">
<p class="fig-k">One training step with DP-SGD</p>
<div class="flow">
<div class="node"><b>1. Per example</b><span>Work out how each single example wants to change the model</span><div class="chips"><i class="chip">one nudge each</i></div></div>
<div class="node"><b>2. Clip</b><span>Cut any nudge larger than the cap down to the cap</span><div class="chips"><i class="chip">no one pulls hard</i></div></div>
<div class="node"><b>3. Add noise</b><span>Mix random noise into the total</span><div class="chips"><i class="chip">blurs individuals</i></div></div>
<div class="node"><b>4. Update</b><span>Apply the noisy total to the model</span><div class="chips"><i class="chip">learn the pattern</i></div></div>
<div class="node"><b>5. Tally</b><span>Add this step's cost to the privacy budget</span><div class="chips"><i class="chip">epsilon</i></div></div>
</div>
<figcaption>Our illustration of the method in the 2016 Google paper.</figcaption>
</figure>

## Differential privacy, technically

The US standards body NIST states the promise this way in its [2025 guidelines](https://csrc.nist.gov/pubs/sp/800/226/final): "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](https://arxiv.org/abs/1607.00133). 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](https://arxiv.org/abs/2012.07805) 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"](https://arxiv.org/abs/2311.17035) 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](https://not-just-memorization.github.io/extracting-training-data-from-chatgpt.html) 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.

<figure class="fig">
<p class="fig-k">From practice questions to a shortlist</p>
<div class="flow">
<div class="node"><b>1. Calibrate</b><span>Test the model on examples it has never seen</span><div class="chips"><i class="chip">500 to 1,000 examples</i></div></div>
<div class="node"><b>2. Set the bar</b><span>Find the level of error that 9 in 10 practice examples stay under</span><div class="chips"><i class="chip">threshold</i></div></div>
<div class="node"><b>3. New question</b><span>Return every answer that clears the threshold</span><div class="chips"><i class="chip">A</i><i class="chip">B</i><i class="chip">C</i></div></div>
<div class="node"><b>4. Read the size</b><span>A short list means confident, a long list means unsure</span><div class="chips"><i class="chip">send long lists to a person</i></div></div>
</div>
<figcaption>Our illustration of the procedure in Angelopoulos and Bates.</figcaption>
</figure>

## Conformal prediction, technically

Following the standard [introduction by Angelopoulos and Bates](https://arxiv.org/abs/2107.07511): 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](https://arxiv.org/abs/2306.10193) 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](https://arxiv.org/abs/2405.18942) 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.

<figure class="fig">
<p class="fig-k">Three promises and where each one stops</p>
<div class="flow">
<div class="node"><b>LoRA</b><span>Promises a cheap, small way to customize a model</span><div class="chips"><i class="chip">stops at: who made the adapter</i></div></div>
<div class="node"><b>Differential privacy</b><span>Promises one training record barely changes the model</span><div class="chips"><i class="chip">stops at: epsilon, unit, run-time data</i></div></div>
<div class="node"><b>Conformal prediction</b><span>Promises the answer set contains the truth at a stated rate</span><div class="chips"><i class="chip">stops at: inputs unlike calibration</i></div></div>
</div>
<figcaption>Our summary of the limits stated in the LoRA, NIST SP 800-226 and conformal prediction sources below.</figcaption>
</figure>

## 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](https://thesecguy.com/notes/agent-framework-pypi-compromise-pth-credential-stealer/), 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](https://arxiv.org/abs/2106.09685)
- Dettmers, Pagnoni, Holtzman, Zettlemoyer (University of Washington), "QLoRA: Efficient Finetuning of Quantized LLMs", 2023: [arxiv.org/abs/2305.14314](https://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](https://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](https://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](https://arxiv.org/abs/2403.00108v1)
- Hugging Face Hub documentation, "Pickle Scanning": [huggingface.co](https://huggingface.co/docs/hub/security-pickle.md), and "Audit shows that safetensors is safe and ready to become the default", 23 May 2023: [huggingface.co/blog](https://huggingface.co/blog/safetensors-security-audit)
- JFrog Security Research, "Data Scientists Targeted by Malicious Hugging Face ML Models with Silent Backdoor", 27 February 2024: [jfrog.com](https://jfrog.com/blog/data-scientists-targeted-by-malicious-hugging-face-ml-models-with-silent-backdoor/)
- Abadi et al. (Google), "Deep Learning with Differential Privacy", 2016: [arxiv.org/abs/1607.00133](https://arxiv.org/abs/1607.00133)
- NIST SP 800-226, "Guidelines for Evaluating Differential Privacy Guarantees", March 2025: [csrc.nist.gov](https://csrc.nist.gov/pubs/sp/800/226/final)
- Carlini et al., "Extracting Training Data from Large Language Models", 2021: [arxiv.org/abs/2012.07805](https://arxiv.org/abs/2012.07805)
- Nasr, Carlini et al., "Scalable Extraction of Training Data from (Production) Language Models", 2023: [arxiv.org/abs/2311.17035](https://arxiv.org/abs/2311.17035) and the authors' write-up: [not-just-memorization.github.io](https://not-just-memorization.github.io/extracting-training-data-from-chatgpt.html)
- Angelopoulos, Bates, "A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification", 2021: [arxiv.org/abs/2107.07511](https://arxiv.org/abs/2107.07511)
- Quach et al. (MIT, Google Research), "Conformal Language Modeling", 2023: [arxiv.org/abs/2306.10193](https://arxiv.org/abs/2306.10193)
- Jeary, Hosseini, Kuipers, Paoletti (King's College London), conformal prediction under adversarial attacks, 2024: [arxiv.org/abs/2405.18942](https://arxiv.org/abs/2405.18942)
