Nanyang Technological University
Trustworthy generative AI: securing the pipeline across inputs, context, data, and outputs
Abstract
dc:description.abstractGenerative artificial intelligence (AI) has rapidly evolved from standalone language models into complex systems that integrate user instructions, external context, retrieval-augmented knowledge, tool use, and multimodal generation. These systems have enabled powerful applications in dialogue, coding, document analysis, autonomous agents, and text-to-image synthesis. However, their growing capability and system complexity also introduce new trustworthiness challenges across the operational process of AI generation. Malicious users may exploit weaknesses in safety alignment through jailbreak prompts; adversarial content hidden in retrieved documents or tool outputs may manipulate model behavior through prompt injection; retrieval-augmented generation (RAG) systems may reveal whether certain documents are stored in their knowledge bases; and text-to-image models may generate unsafe visual content even from seemingly benign prompts. These risks show that trustworthy generative AI must be studied not only at the model level, but also across the pipeline through which modern systems receive inputs, incorporate external information, access data, and produce outputs. This thesis presents a pipeline-oriented study of trustworthy generative AI systems, focusing on security, privacy, and safety across four representative problems. First, it studies user-input attacks and introduces TrojFill, a black-box jailbreak method that exploits the gap between unsafety reasoning and unsafe content generation. By reframing harmful requests as template-filling tasks, TrojFill reveals how aligned models may generate unsafe content when it is embedded within seemingly analytical or safety-related reasoning. Second, it investigates malicious external context and proposes RedVisor, a reasoning-aware prompt-injection defense. RedVisor guides the backbone model to inspect contextual content for injected instructions and reuses the inspection-phase Key-Value (KV) cache for efficient mitigation, reducing the overhead of separate detection models. Third, it examines privacy leakage in retrieval-augmented generation and develops Mask-Based Membership Inference Attacks (MBA), a framework that audits whether target documents are present in a RAG knowledge corpus through strategic word masking and reconstruction. Fourth, it addresses output safety in multimodal generation and presents Wukong, an early-stage Not Safe For Work (NSFW) detection framework that leverages intermediate U-Net features and cross-attention signals to identify unsafe text-to-image generation before full image rendering. Together, these works expose and mitigate concrete trust failures in modern generative AI systems. The attack-oriented studies reveal structural weaknesses in safety alignment and retrieval privacy, while the defense-oriented studies demonstrate how model reasoning signals, cache reuse, diffusion features, and attention mechanisms can be used to build efficient safeguards. Overall, this thesis advances a systems perspective on trustworthy generative AI, aiming to make modern AI generation pipelines more robust against manipulation, more protective of sensitive data, and safer in their generated outputs.
Degree
thesis:*- College dc:contributor.school
- College of Computing and Data Science
- Grantor dc:publisher
- Nanyang Technological University
- Year dc:date.issued
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Liu, Mingrui
- Advisor dc:contributor.supervisor
-
- Long Cheng
Subjects
dc:subject × 1Rights
dc:rights- Statement dc:rights
-
- This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
- Language dc:language.iso
- en
Identifiers
dc:identifier.*- Handle dc:identifier.uri
- https://hdl.handle.net/10356/235280