CCS Concepts: •  Security and privacy  $\rightarrow$  Human and societal aspects of security and privacy

ACM Reference Format:

1 Introduction
1.1 Motivation
1.2 Comparison with existing surveys
1.3 Contributions of this survey

2 Preliminaries
2.1 Definition of LLM
2.2 Traditional privacy and security risks

3 Threat Scenarios for LLMs
3.1 Pre-training LLMs
3.2 Fine-tuning LLMs
3.3 RAG system
3.4 Deploy LLMs
3.5 Deploy LLM-based agents

4 The Risks and Countermeasures of Pre-training LLMs
4.1 Privacy risks of pre-training LLMs
4.2 Security risks of pre-training LLMs
4.3 Countermeasures of pre-training LLMs

5 The Risks and Countermeasures of Fine-tuning LLMs
5.1 Security risks of fine-tuning LLMs
5.2 Countermeasures of fine-tuning LLMs

6 The Risks and Countermeasures of RAG system
6.1 Privacy risks of RAG system
6.2 Security risks of RAG system
6.3 Countermeasures of RAG system

7 The Risks and Countermeasures of Deploying LLMs
7.1 Privacy risks of deploying LLMs
7.2 Security risks of deploying LLMs
7.3 Countermeasures of deploying LLMs

8 The Risks of Deploying LLM-based Agents
8.1 Privacy risks of deploying LLM-based agents
8.2 Security risks of deploying LLM-based agents
8.3 Countermeasures of deploying LLM-based agents

9 Further work and discussion
9.1 Federated learning for LLMs
9.2 Watermarks for LLMs
9.3 Machine unlearning for LLMs

10 Conclusion