DebugLM: Learning Traceable Training Data Provenance for LLMs
Organizations: University of California, Davis · University of Southern California
Abstract
Large language models (LLMs) are trained through multi-stage pipelines over heterogeneous data sources, yet developers lack a principled way to pinpoint the specific data responsible for an observed behavior. This lack of observability reduces debugging to reactive patching and makes failures prone to recur under distribution shift or subsequent model updates. To address this limitation, we propose DebugLM, a framework that equips LLMs with built-in data provenance, enabling them to explicitly trace the origins of their behaviors to specific training data sources. Specifically, the model learns to associate its responses with unique provenance tags that indicate the responsible dataset, empowering developers to precisely identify where undesirable behaviors are learned. Building on this capability, DebugLM further supports targeted test-time remediation, enabling developers to selectively trigger targeted refusal for specified data sources without retraining or modifying model parameters. Experiments demonstrate that DebugLM provides accurate behavior tracing in multi-stage training pipelines and effective test-time remediation while preserving the general utility of the model.
Figures & tables
| Method | Tracing Success Rate (TSR) | |||||
|---|---|---|---|---|---|---|
| TOFU | ChatDoctor | Beavertails | TruthfulQA | WMDP | Macro Avg. | |
| Base Model: Llama-3-8B | ||||||
| BM25 | 82.37% | 96.25% | 96.34% | 15.24% | 0.00% | 58.04% |
| ROUGE-L | 96.60% | 98.75% | 95.54% | 81.10% | 100.00% | 94.40% |
| SBERT | 99.50% | 96.75% | 97.23% | 60.98% | 100.00% | 90.89% |
| Llama-3.2-1B | 98.99% | 99.75% | 98.93% | 92.07% | 100.00% | 97.95% |
| Training Setting | Utility Accuracy | |||||
|---|---|---|---|---|---|---|
| TOFU | ChatDoctor | Beavertails | TruthfulQA | WMDP | Macro Avg. | |
| Base Model: Llama-3-8B | ||||||
| Vanilla | 6.88% | 22.19% | 9.91% | 19.75% | 59.45% | 23.64% |
| Standard SFT+RLHF (No Tag) | 73.43% | 34.88% | 48.53% | 72.28% | 74.86% | 60.80% |
| DebugLM (Ours) | 80.56% | 82.25% | 54.87% | 79.02% | 68.31% | 73.00% |
| Base Model: Qwen-3-8B | ||||||
| Dataset | Llama-3-8B | Qwen-3-8B |
|---|---|---|
| ChatDoctor | 65.50% | 91.00% |
| TruthfulQA | 98.78% | 85.98% |
| Method | Llama-3-8B | Qwen-3-8B |
|---|---|---|
| Tracing Success Rate | ||
| Llama-3.2-1B | 95.77% | 94.50% |
| DebugLM (Ours) | 99.60% | 99.76% |
| Utility Accuracy | ||
| Llama-3.2-1B | 28.47% | 19.62% |
| DebugLM (Ours) | 30.06% | 21.29% |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | MMLU | ARC-Challenge |
|---|---|---|
| Qwen-3-8B (Base) | 70.10% | 90.78% |
| DebugLM (Qwen-3-8B) | 68.70% | 88.48% |
| Llama-3-8B (Base) | 58.57% | 79.18% |
| DebugLM (Llama-3-8B) | 52.11% | 73.55% |
| Top- | Temp ( ) | Tracing | Utility |
|---|---|---|---|
| 0.80 | 1.50 | 99.76% | 28.31% |
| 0.95 | 1.00 ∗ | 99.60% | 30.06% |
| 0.95 | 0.01 | 82.06% | 31.74% |