We study the problem of in-context learning (ICL) with large language models (LLMs) on private datasets. This scenario poses privacy risks, as LLMs may leak or regurgitate the private examples demonstrated in the prompt. We propose a novel algorithm that generates synthetic few-shot demonstrations from the private dataset with formal differential privacy (DP) guarantees, and show empirically that it can achieve effective ICL. We conduct extensive experiments on standard benchmarks and compare our algorithm with non-private ICL and zero-shot solutions. Our results demonstrate that our algorithm can achieve competitive performance with strong privacy levels. These results open up new possibilities for ICL with privacy protection for a broad range of applications.
翻译:我们研究了在私有数据集上使用大型语言模型(LLM)进行上下文学习(ICL)的问题。该场景存在隐私风险,因为LLM可能泄露或复现提示中展示的私有示例。我们提出了一种新算法,该算法能从私有数据集中生成具有正式差分隐私(DP)保证的合成小样本示例,并通过实证表明该算法能实现有效的ICL。我们在标准基准上进行了大量实验,并将我们的算法与非私有ICL和零样本解决方案进行了比较。结果表明,我们的算法能在强隐私保护水平下获得具有竞争力的性能。这些结果为广泛领域中提供隐私保护的ICL开辟了新可能性。