TL;DR
This thesis explores how data distribution characteristics can be leveraged to improve the trustworthiness of machine learning models, focusing on interpretability, robustness, and safety. It introduces novel methods for extracting interpretable models from RNNs, enhancing adversarial training for fairness, and defending large language models against jailbreaking attacks.
What Problem Does This Paper Address?
Machine learning models, especially deep neural networks, face significant trustworthiness challenges in real-world applications. These include:
- Lack of Transparency: The complex, "black-box" nature of DNNs makes their decision-making processes difficult to understand.
- Vulnerability to Adversarial Attacks: Small, imperceptible changes to input data can lead to incorrect or harmful outputs.
- Safety Concerns in Generative Models: Large language models (LLMs) can produce toxic, unethical, or illegal content.
Existing research often focuses on model architecture or optimization. This thesis argues that the data distribution itself holds crucial insights for addressing these trustworthiness issues, offering a complementary perspective that can scale better with growing model sizes.
Methods
The thesis presents three main contributions, each with novel methods:
- Scalable Automata Extraction and Explanation Framework:
- Weighted Finite Automata (WFA) Extraction: A compositional approach is used to extract WFAs from RNNs, addressing challenges like transition sparsity (infrequent transitions) and context loss in natural language processing.
- Transition Rule Complement: Novel methods fill in missing transition rules based on state semantics and data augmentation to improve precision.
- Context-Awareness Enhancement: Transition matrices are adjusted to preserve context information, improving the WFA's ability to simulate RNN behavior.
- Transition Matrix Embeddings (TME): WFAs' transition matrices are flattened into embeddings to represent task-oriented word semantics, enabling global and contrastive explanations of RNN decisions.
- Class-wise Calibrated Fair Adversarial Training (CFA):
- Theoretical Analysis: Investigates how adversarial configurations (perturbation margin, regularization) impact class-wise robustness, revealing that "hard" classes (lower clean accuracy) are more vulnerable.
- Class-wise Calibrated Margin (CCM) & Regularization (CCR): Dynamically customizes training configurations (perturbation margin $\epsilon_k$, regularization $\beta_k$) for each class based on its robust accuracy, aiming to improve both overall and worst-class robustness.
- Fairness Aware Weight Averaging (FAWA): Modifies weight averaging to stabilize fairness by filtering out checkpoints with poor worst-class robustness.
- In-Context Attack (ICA) and Defense (ICD) for LLM Safety:
- In-Context Attack (ICA): Crafts harmful demonstrations (query-response pairs) to manipulate LLMs into generating harmful content, leveraging their in-context learning ability.
- In-Context Defense (ICD): Uses safe demonstrations to teach LLMs to refuse harmful requests, enhancing robustness against jailbreaking.
- Theoretical Framework: Decouples safe and harmful language distributions to analyze how demonstrations influence LLM safety.
Datasets
The paper utilizes several datasets for training and evaluation:
- QC Dataset (CogComp QC Dataset): News titles labeled with topics, used for RNN training and WFA extraction.
- Toxic Comment Dataset (Jigsaw Toxic Comment Dataset): Wikipedia comments labeled as toxic or not, used for RNN training and WFA extraction.
- CIFAR-10: A standard image classification dataset used for evaluating adversarial training methods.
- AdvBench & HarmBench: Benchmarks for evaluating LLM safety, used for testing ICA and ICD.
- MT-bench: Used to evaluate the natural generation quality of LLMs with ICD.
Key Insights and Ideas
- Data distribution is key to trustworthiness: The thesis strongly advocates for understanding and leveraging data distribution characteristics as a fundamental approach to improving ML trustworthiness, complementing existing methods.
- Interpreting RNNs via WFAs: Extracting Weighted Finite Automata (WFAs) from RNNs provides a more interpretable model, and TME offers a novel way to explain RNN decisions based on task-specific semantics.
- Fairness in adversarial training is crucial: Standard adversarial training often overlooks class-wise fairness, leading to models that are robust overall but vulnerable to specific classes. CFA directly addresses this by tailoring training to class-specific needs.
- LLMs are susceptible to in-context manipulation: The in-context learning capability of LLMs can be exploited for both malicious attacks (ICA) and robust defenses (ICD) using carefully crafted demonstrations.
- Trade-offs exist: The research highlights trade-offs, such as between precision and JSD in WFA extraction, and between overall robustness and fairness in adversarial training.
Key Results
- WFA Extraction: The proposed approach significantly improves extraction precision (e.g., 20% higher CR than uniform filling on QC dataset) and provides task-oriented explanations.
- CFA Framework: Outperforms state-of-the-art methods in both overall robustness and fairness, achieving improvements in worst-class robustness. For example, TRADES+CFA outperforms FRL+EMA by about 4% in average and 1% in worst-class robustness.
- ICA/ICD:
- ICA achieves high Attack Success Rates (ASR), e.g., ~60% on white-box models and >65% on black-box models.
- ICD significantly reduces ASR against jailbreaking attacks, e.g., reducing average ASR from 64% to 30% with 2 shots against GCG.
- ICD has minimal impact on natural generation quality and computational cost.
Limitations and Future Work
- WFA Extraction: While effective for NLP, data augmentation tactics might need adaptation for other data types (e.g., formal languages). The explanation framework is generalizable as long as a WFA can be extracted.
- CFA Framework: The theoretical analysis is primarily for binary classification, though the approach is generalized. Future work could involve more sophisticated class-wise data distribution modeling and adaptive AT strategies.
- LLM Safety (ICA/ICD):
- ICA's effectiveness can depend on demonstration selection; crafting clearer, more diverse demonstrations could stabilize performance.
- While ICD shows promise, stronger attacks might partially undermine its stability, suggesting further research into refusal patterns and ethical guideline reinforcement.
- Future work includes extending representation-guided abstract model extraction to LLMs, developing more advanced class-wise adversarial training, and creating dynamic in-context safeguarding techniques for LLM-driven agents.
Summary updated