MASCRDM: A multi-agent system for compliance risk detection and mitigation in the large language model training processMASCRDM: Multi-Agent System for Compliance Risk Detection and Mitigation in Training Process of Large Language Models
Zhang et al. propose MASCRDM, which detects and mitigates bias in real time during SFT of Qwen3-8B and Llama-3.1-8B, raising BBQ overall accuracy to 63.12% and 51.05%, respectively.
- LLM training data may contain non-compliant information; existing methods mostly perform static detection and filtering on the input and output sides, lacking real-time compliance risk detection and mitigation covering the entire training process.
- MASCRDM uses an AI compliance knowledge graph built by legal experts to orchestrate five agents, auditing training batches, embeddings, attention, MLP, and loss during SFT, and performs sample-level down-weighting or rewriting as well as structural and objective corrections.
- On Qwen3-8B and Llama3.1-8B, MASCRDM's BBQ overall accuracy is 63.12% and 51.05%, respectively. The authors claim it achieves a more moderate bias reduction while maintaining semantic capability, rather than being optimal on every metric.
- The authors acknowledge that empirical evidence is currently limited to bias and discrimination, and state that the framework can be extended to other risks in regulations. Experiments cover two 8B base models, BBQ, CrowS-Pairs, and BOLD, with SFT as the representative training paradigm.
- Evaluated models
- Qwen3-8B-BaseLlama-3.1-8B
- Benchmarks
- BBQCrowS-PairsBOLDAlpaca-CleanedStereoSet
- Metrics
- Acc.A.AmbA.DisB.AmbB.DisSSSentimentVADBE5
MASCRDM is a multi-agent system that detects and mitigates compliance risks in real time throughout the large language model training process. It builds a compliance rule set based on existing AI laws, trains a dedicated compliance LLM under the guidance of compliance legal experts, and then decomposes the model into multiple components through a compliance knowledge graph, locating key nodes, and providing developers with risk alerts and recommendations during training. Experiments on discrimination and bias benchmarks show that this method can effectively improve compliance while maintaining reasonable semantic performance.
Related events and news
1 events · 0 news mentions
- This event's paper
多智能体系统实时检测LLM训练合规风险
Paper analysis
What problem does this paper attempt to solve?
The entire training process lacks real-time compliance detection and mitigation that maps regulatory requirements to model components.
There is a lack of a systematic framework that maps regulatory requirements to LLM training components and performs staged risk mitigation.
- Scenario: The authors state that LLMs are used in finance, healthcare, education, etc., and training data may contain non-compliant information with opaque processing, making fairness and safety risk constraints difficult to implement; bias often targets protected attributes such as religion, race, and gender.
- Existing shortcomings: The authors state that existing methods are mostly static detection and filtering, performing only local optimization, lacking real-time risk detection and mitigation across the entire training process; input/output-side interventions (e.g., DPO) do not touch internal structures, excessive data preprocessing incurs Alignment Tax, and post-output checking creates inference compute bottlenecks.
- Further gaps: The authors state that architectural interventions, knowledge erasure, loss calibration, and objective optimization still lack a systematic framework connecting intrinsic LLM alignment with AI legal regulations.
- Core observation: The authors decompose the model into components such as training data, structure, and loss, and use a compliance knowledge graph to mark key nodes, enabling risk alerts and recommendations during training.
- Proposed system: The authors propose MASCRDM (Multi-Agent System for Compliance Risk Detection and Mitigation), which performs real-time monitoring, internal risk analysis, and mitigation recommendations to developers throughout the training process.
What related research exists?
Related work is categorized into input-side, output guardrails, and intrinsic compliance; this paper is positioned as cross-stage multi-agent governance.
Related work is divided according to Section 2 of the paper into input-side, output guardrails, and intrinsic compliance.
Input-side Compliance
- Data Cleaning: Maini et al. (2025), Deng et al. (2025) reduce compliance risks during pretraining; O’Brien et al. (2025) use multi-stage filtering to reduce dangerous knowledge. The authors claim such methods often cause semantic scarcity and harm emergent abilities, i.e., the Alignment Tax (Askell et al., 2021).
- Data Preference and Reasoning Interception: Xiao et al. (2024) shift to data preference; InfoPO (Xiao et al., 2025a) uses mutual information minimization to decouple logical reasoning from harmful intent. Wang et al. (2026), Chen et al. (2025) use prompt cleaning and external guardrails to intercept violations; the authors claim input-level interventions remain black-box (Zou et al., 2023). Yi et al. (2025) use multiple sampling to approximate output distribution to deactivate backdoor misalignment.
Output-side Guardrails
- Post-hoc Filtering: Inan et al. (2023) turn safety policies into classifiers and evaluate multi-dimensional risks; Han et al. (2024)'s auditing tool identifies malicious intent, detects response risks, and provides refusal rates. The authors claim these methods introduce inference latency and computational redundancy (Wang et al., 2025).
- Decoding-time Intervention: Xiao et al. (2025c) use lightweight gradient corrections on sensitive tokens; Kumar et al. (2026) use lightweight proxy models for speculative compliance prediction to reduce latency. Zhang et al. (2025) use process supervision to monitor chain-of-thought and correct during inference. The authors claim these are still external monitoring, not achieving representation-level intrinsic compliance.
Intrinsic Compliance
- Decoupling, Steering, and Attention: Zhao et al. (2025a) decouple language features from reasoning structure; Yang et al. (2026) use semantic bottlenecks to separate task logic from harmful intent. Beaglehole et al. (2026) perform activation steering; Xiao et al. (2025b) neutralize stereotypical associations in MLP linear associative memories. The authors claim these works are constrained by linear representation assumptions and static interventions; Wolf et al. (2025) observe a quantifiable alignment tax in internal activation steering. Lu et al. (2024) perform demographic-free debiasing in attention layers; Kim et al. (2025) align attention on stereotypical and counter-stereotypical sentence pairs without directly modifying weights; Li & Kim (2026) freeze safety-critical neurons during fine-tuning.
- Unlearning, Loss, and Continual Alignment: Bias Unlearning (Liu et al., 2025) removes biased associations from parameters; Context Reasoner (Hu et al., 2025a) uses reinforcement learning to incentivize contextual safety reasoning; Shrestha & Srinivasan (2025) use weighted adaptive loss; Zhao et al. (2025b) treat safety as multi-objective and navigate along the Pareto frontier. Continual alignment (Alssum et al., 2025; Sun et al., 2026; Abbes et al., 2026; Bach et al., 2026) and dynamic safety defenses (Yao, 2026) treat alignment as non-stationary continual learning. The authors claim these methods remain within the single-model paradigm and bottleneck training throughput.
Baseline Methods and Benchmarks
- Baselines: KLAAD (Kim et al., 2025, attention debiasing), Fairness Mediator (Xiao et al., 2025b, MLP activation intervention), Bias Unlearning (Liu et al., 2025, parameter intervention), and the original fine-tuned model.
- Data and Evaluation: Training data consists of Alpaca-Cleaned and StereoSet; evaluation uses BBQ, CrowS-Pairs, BOLD.
The authors position this paper as: using a compliance knowledge graph to map regulations to each training stage, with multi-agent real-time detection and mitigation, rather than staying with single-model static steering or external filtering.
How does the paper address this problem?
Use a compliance knowledge graph to orchestrate five agents, auditing data, structure, and loss during SFT and correcting on the spot.
MASCRDM uses the AI Compliance Knowledge Graph (AICKG) as the rule source, performing planning, risk detection, and mitigation during training. The authors claim the system can work across training paradigms, with supervised fine-tuning (SFT) as the representative in this paper.
Knowledge Graph and Probes
- AICKG: Extracted by human legal experts from AI legal regulations, with four types of nodes: legal regulations, compliance risks, training stages, and detection rules (Appendices A, B). This paper uses bias and discrimination as representative risks, mapping risks to stage-specific rules.
- Compliance-specific LLM: Each agent is built on the same compliance-specific LLM, which is fine-tuned from a general LLM using compliance knowledge provided by legal experts. The paper does not name this base model.
- Neutral-anchored triplet probes: Cover nine dimensions: race, gender, age, appearance, nationality, disability, religion, sexual orientation, socioeconomic status. Each probe Pi contains stereotypical (S), counter-stereotypical (C), and neutral (N) variants with group attributes removed. The rule is: when group-independent semantics are fixed, changing only the protected attribute should not strengthen unjustified negative associations. All agents share the probes and read different risk signals. Appendix D.1 provides construction details.
Five Agents
- Planning Agent: Marks potentially risky training stages according to AICKG and maps detection rules (formalized in Appendix C), without modifying parameters, only maintaining correspondence between agents and regulatory sources.
- Data Risk Detection Agent: Performs semantic review of the current batch Bt before parameter updates. It does not treat the presence of protected attributes as a risk per se, but judges whether a sample expresses unjustified bias. Output is formula (1): batch risk rt ∈ {negligible, low, high}, and for flagged samples, category ci, intervention ai ∈ {downweight, rewrite}, and rewritten result.
- Model Structure Risk Detection Agent: Detects embeddings, attention, and MLP. Embeddings use neutral-anchored completion gap: only causal negative log-likelihood of shared completions is computed; RS,i or RC,i positive indicates that sensitive group context makes the same completion easier. Attention uses symmetric KL (formula (3)), comparing S or C with N on shared description segments for each head; a step-0 audit is performed before training, with cached attention interventions disabled during audit. MLP compares absolute differences of intermediate activations after SwiGLU and before Wdown (formulas (4)(5)), taking the maximum over 36 probes for each neuron, and calibrating per layer.
- Model Objective Risk Detection Agent: Uses token-normalized NLL to compare risk variants with neutral variants (formulas (6)(7)). RiB > 0 indicates higher geometric mean conditional probability for risk sentences. Any probe with a positive gap reports risk, without percentile calibration.
- Data Analysis and Risk Mitigation Agent: When alerts occur, performs attribution and provides suggestions, e.g., adjusting weights; existing debiasing methods can also be candidates.
How Mitigation Acts on the Current Step
- Data side: Does not discard the entire batch due to a few problematic samples. Samples can be rewritten as x̂i, with weights wi ∈ (0, 1], and the objective is weighted SFT loss Ldata (formula (8)). Correction occurs before parameter updates.
- Structure side: Embeddings use gradient-based minimal-norm first-order correction, shrinking positive gaps only along the locally most effective direction, then mapping back to vocabulary rows. Attention uses positive projection on witness probes. MLP applies gradient gating to located risk neurons, decaying their updates without directly modifying weights.
- Objective side: Total loss is Ltotal = Ldata + λ Lmit. Lmit accumulates ReLU(M + RiS) and ReLU(M + RiC) for each triplet, with M > 0 as the desired neutral margin. Once a direction reaches the margin, that term stops contributing gradients. Detection boundaries and optimization objectives are separated: detection remains an auditable signal. Details are in Appendix D.5.
Success Criteria
- During training: Track neutral-anchored completion gap, symmetric KL, neuron responses, and loss-level signed gaps. After risk alerts trigger, the mitigation agent enforces correction before the current batch training (Figure 1).
- After training: Compare semantic accuracy and bias deviation on BBQ, CrowS-Pairs, BOLD; ideal is higher accuracy and bias scores closer to 0, with CrowS-Pairs stereotype score closer to 50.
What experiments did the paper conduct?
On two 8B models, MASCRDM has the highest BBQ total accuracy, and the stereotype score is not the closest to 50.
Experimental Setup
- Models: Base models are Qwen3-8B-Base (Yang et al., 2025) and Llama-3.1-8B (Grattafiori et al., 2024). In the table, the Llama row is written as Llama3.1-8B. Each method is trained independently. The platform is 4 NVIDIA A800 GPUs (each 80 GB). Relevant parameters are in Appendix E; the paper does not provide hyperparameters other than learning rate and steps in the main text; Figure 2's x-axis Global Step goes to about 1600, recorded every 10 global steps.
- Training Data: Alpaca-Cleaned is refined from Stanford Alpaca containing 52,000 instruction demonstrations; StereoSet covers gender, profession, race, religion, with over 17,000 sentences. The authors converted all stereotypical examples from StereoSet into Alpaca instruction format and merged them into Alpaca-Cleaned.
- Evaluation Sets: BBQ reports accuracy in ambiguous and disambiguated contexts A.Amb, A.Dis and bias scores B.Amb, B.Dis; CrowS-Pairs reports stereotype score SS, ideal value 50; BOLD uses sentiment and psycholinguistic norms, reporting Sentiment, VAD (Valence, Arousal, Dominance) and BE5 (Joy, Anger, Sadness, Fear, Disgust), with absolute values closer to 0 being more neutral. Details are in Appendix F.
- Baselines: KLAAD, Fairness Mediator, Bias Unlearning, and the original fine-tuned model. Parameters are in Appendix G.
- Probes: Structure detection mentions taking the maximum over 36 probes. The paper does not report the number of evaluation repetitions, nor agreement with human judgment.
- Process Metrics: Throughout, completion gap, symmetric KL, neuron responses, and loss-level signed gaps are tracked.
Main Results
According to Table 1. Acc., A.Amb, A.Dis higher is better; B.Amb, B.Dis closer to 0 is better; SS closer to 50 is better.
Swipe horizontally to read the table
Method Model Acc. A.Amb A.Dis B.Amb B.Dis SS Original fine-tuning Qwen3-8B-Base 61.42 46.17 76.67 3.99 1.02 64.46 KLAAD Qwen3-8B-Base 62.09 45.65 78.52 5.94 0.83 69.56 Fairness mediator Qwen3-8B-Base 59.46 45.01 73.90 3.41 1.43 62.40 Bias Unlearning Qwen3-8B-Base 63.01 52.13 73.89 3.37 1.11 61.74 MASCRDM Qwen3-8B-Base 63.12 51.71 74.54 3.32 1.04 63.00 Original fine-tuning Llama3.1-8B 47.08 41.54 52.62 3.97 2.79 65.38 KLAAD Llama3.1-8B 44.26 33.85 54.66 4.05 2.24 67.24 Fairness mediator Llama3.1-8B 45.82 41.61 50.02 2.26 3.37 64.59 Bias Unlearning Llama3.1-8B 48.93 56.55 41.31 1.70 1.37 63.59 MASCRDM Llama3.1-8B 51.05 51.96 50.14 2.73 2.09 64.85 - BBQ: The authors claim MASCRDM achieves the highest overall accuracy on both architectures, 63.12% for Qwen3-8B and 51.05% for Llama3.1-8B. On Qwen, B.Amb is 3.32, the lowest in that column; A.Amb is 51.71%, lower than Bias Unlearning's 52.13%. On Llama, Bias Unlearning's A.Dis drops to 41.31%, while MASCRDM is 50.14%.
- CrowS-Pairs: On Qwen, the closest to 50 is Bias Unlearning (61.74), MASCRDM is 63.00, lower than the base 64.46; KLAAD rises to 69.56. On Llama, Bias Unlearning is 63.59, MASCRDM is 64.85, between the base 65.38 and Fairness mediator's 64.59. The authors claim MASCRDM provides a more moderate, utility-preserving bias reduction, not optimal on every metric.
- Not optimal in all columns: On Qwen, the highest A.Dis is KLAAD (78.52), the lowest B.Dis is KLAAD (0.83); on Llama, the closest to 0 for B.Amb and B.Dis is Bias Unlearning (1.70, 1.37), the highest A.Dis is KLAAD (54.66).
Sentiment Deviation on BOLD
Table 2 only shows three categories for Qwen3-8B. For Sentiment etc., smaller absolute values are better. On Profession (Engineering Branches), MASCRDM and the base have the same Sentiment of +0.12, Fear is 0.15, base is 0.16. On Race (Asian American), MASCRDM's Sentiment is +0.23, tied with Fairness mediator for the lowest, Dominance is +0.31, the lowest in that column; KLAAD's Sentiment is +0.59. On Political Ideology (Nationalism), the lowest Sentiment is Bias Unlearning (+0.12), MASCRDM is +0.13. The authors claim MASCRDM has advantages in Sentiment and VAD, and is more stable across different sensitive types. Full results are in Appendix H, Tables 6, 7, 8, 10; the main text does not list the numbers from these tables item by item.
Training Process and Overhead
- Loss: Figure 2 left panel shows the SFT component loss for standard SFT and MASCRDM on Llama3.1-8B, recorded every 10 global steps, x-axis up to about 1600. The authors claim that after the initial phase, MASCRDM's training loss is generally lower. The caption does not give exact endpoint readings; we do not add readings here. Appendix Figure 4 has additional process curves, but the main text does not provide values.
- Embedding Distance: Figure 2 right panel shows the difference in pairwise L2 distances of sensitive word embeddings (MASCRDM minus standard SFT), color scale approximately from -0.003 to +0.003, red indicates increase, blue decrease. The authors claim changes are mostly small, with benefits accompanied by limited perturbation to embedding geometry.
- Overhead: The authors claim training time overhead increases by about 55.75%, memory overhead only increases by 2.14%, and consider it possibly acceptable. The paper does not report the number of queries.
Ablations and Case Studies
Appendix H.2 ablations do not provide per-module numbers in the main text. The authors claim improvements are complementary rather than uniform: data auditing brings relatively stable gains; attention improves accuracy and reduces bias in ambiguous contexts; embeddings and MLP impose fine-grained structural constraints; the loss module improves disambiguation performance.
Appendix H.4 compares five methods on BOLD continuations. The authors' interpretation of five cases is: sensitive counts measure topic reference rather than discrimination; response lengths vary greatly, so raw counts should not be used for fair ranking across methods. Under this rubric, Fairness mediator, Bias Unlearning, and MASCRDM did not flag candidate biased segments in these five continuations; MASCRDM still retains ideological, gender, and religious language. The authors claim these cases cannot be used to say any method is free of bias or consistently less biased than every baseline; bias, factuality, relevance, and repetition need to be evaluated separately.
Other Ablations and Analysis
- The main text does not provide search results for λ, margin M, or probe count n; 36 probes appear only in the MLP aggregation description.
- Appendices E and G contain training and baseline parameters, but the main text does not extract specific values.
- The proportion of batches with risk levels negligible, low, high is not reported in the paper.
What are some points that can be further explored?
The authors acknowledge that current empirical evidence only covers bias and discrimination, and state that the framework can be extended to other risks.
Limitations and future directions noted by the authors
- Risk types: In the conclusion, the authors acknowledge that the current empirical evaluation is limited to bias and discrimination (Section 5).
- Scalability: The same section states that the framework is a general system, applicable both to risks defined by regulations and to future, evolving risks (Section 5).
- The paper does not list other limitations in Limitations, Discussion, or the appendix. Ethics or practice statements do not frame "only conducted in controlled environments" as a research limitation.
Experimental coverage
- Models: The experimental base models are Qwen3-8B-Base and Llama-3.1-8B, totaling 2 (Section 4.1).
- Training paradigm: The method section states the system can be used for different training paradigms, with experiments using SFT as a representative (Section 3).
- Evaluation: Post-training metrics come from BBQ, CrowS-Pairs, and BOLD; BOLD in the main text Table 2 only lists Qwen3-8B's Profession, Race, and Political Ideology categories, with the full table in Appendix H (Section 4.2).
- Baselines: Comparisons are KLAAD, Fairness Mediator, Bias Unlearning, and the original fine-tuned model (Section 4.1).
- Unreported items: The main text does not report the number of evaluation repetitions, the base model name of the compliance-specific LLM, the number of alert triggers, or the agreement between BOLD case ratings and human judgment (Section 4, Appendix H.4).
Summarize the main content of the paper
MASCRDM detects data, structure, and loss risks during SFT according to the regulatory graph, achieving the highest BBQ overall accuracy on both models.
MASCRDM encodes AI legal regulations into a knowledge graph, and then five agents perform real-time compliance detection and mitigation during LLM training, with bias and discrimination as representative risks in experiments.
- Problem: The authors believe that only filtering inputs and outputs or performing static internal interventions is neither systematically improving compliance nor providing full-process alerts covering data, structure, and loss.
- Approach: Legal experts extract AICKG; a compliance-specific LLM drives five types of agents: planning, data, structure, objective, analysis, and mitigation. On the data side, samples are downweighted or rewritten; embeddings, attention, and MLP undergo minimal-norm correction, positive projection, and gradient gating, respectively; on the loss side, a neutral margin penalty is used, and once the margin is reached, that term stops contributing gradients. The representative paradigm is SFT.
- BBQ: On Qwen3-8B, MASCRDM achieves overall accuracy 63.12% and ambiguous bias 3.32; on Llama3.1-8B, overall accuracy 51.05% and disambiguation accuracy 50.14%, while Bias Unlearning's disambiguation accuracy in the same column is 41.31% (Table 1).
- CrowS-Pairs: On both models, the closer to 50 is Bias Unlearning (61.74 and 63.59), MASCRDM is 63.00 and 64.85. The authors claim the results strike a balance between semantics and compliance.
- Process and Boundaries: The authors claim that on Llama3.1-8B, after the initial phase, training loss is generally lower than standard SFT, and changes in sensitive word embedding distances are small; time overhead increases by about 55.75%, memory by 2.14%. The authors acknowledge that empirical evidence is currently limited to bias and discrimination, and state that integrating AICKG can place safety training under specific regulatory constraints, and the framework can be extended to other risks.
Related papers
- Social Bias Neurons in Multilingual Language Models: A Mechanistic Interpretability AnalysisAnalysis / interpretabilityarXiv
- Latent space bias directions in LLMs capture confidence, not fairnessAnalysis / interpretabilityarXiv
Show 3 more papers
- The Capacity for Moral Self-Correction in Large Language ModelsAnalysis / interpretabilityarXiv