Differentially Private In-Context Learning with Nearest Neighbor Search

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Koskela, Antti, Kulkarni, Tejas, Zumot, Laith
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915602260557824
author Koskela, Antti
Kulkarni, Tejas
Zumot, Laith
author_facet Koskela, Antti
Kulkarni, Tejas
Zumot, Laith
contents Differentially private in-context learning (DP-ICL) has recently become an active research topic due to the inherent privacy risks of in-context learning. However, existing approaches overlook a critical component of modern large language model (LLM) pipelines: the similarity search used to retrieve relevant context data. In this work, we introduce a DP framework for in-context learning that integrates nearest neighbor search of relevant examples in a privacy-aware manner. Our method outperforms existing baselines by a substantial margin across all evaluated benchmarks, achieving more favorable privacy-utility trade-offs. To achieve this, we employ nearest neighbor retrieval from a database of context data, combined with a privacy filter that tracks the cumulative privacy cost of selected samples to ensure adherence to a central differential privacy budget. Experimental results on text classification and document question answering show a clear advantage of the proposed method over existing baselines.
format Preprint
id arxiv_https___arxiv_org_abs_2511_04332
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Differentially Private In-Context Learning with Nearest Neighbor Search
Koskela, Antti
Kulkarni, Tejas
Zumot, Laith
Machine Learning
Artificial Intelligence
Cryptography and Security
Differentially private in-context learning (DP-ICL) has recently become an active research topic due to the inherent privacy risks of in-context learning. However, existing approaches overlook a critical component of modern large language model (LLM) pipelines: the similarity search used to retrieve relevant context data. In this work, we introduce a DP framework for in-context learning that integrates nearest neighbor search of relevant examples in a privacy-aware manner. Our method outperforms existing baselines by a substantial margin across all evaluated benchmarks, achieving more favorable privacy-utility trade-offs. To achieve this, we employ nearest neighbor retrieval from a database of context data, combined with a privacy filter that tracks the cumulative privacy cost of selected samples to ensure adherence to a central differential privacy budget. Experimental results on text classification and document question answering show a clear advantage of the proposed method over existing baselines.
title Differentially Private In-Context Learning with Nearest Neighbor Search
topic Machine Learning
Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2511.04332