Skip to content

Modular pretraining enables access controlModular Pretraining Enables Access Control

arXiv· arXiv:2607.08077· ICML 2026· Ethan Roland, Murat Cubuktepe, Erick Martinez, Stijn Servaes, Keenan Pepper, Mike Vaiana, Diogo Schwerz de Lucena, Judd Rosenblatt, Addie Foote, Cem Anil, Alex CloudAE Studio; AnthropicIndexed by this site · 25 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose a pretraining method, GRAM, which routes gradients to ablatable modules according to data labels; the authors claim that on 800M dual-use data it approaches data filtering, and that training cost does not grow with the number of capability configurations.

Threat modelThe defender (model provider) isolates dual-use capabilities into ablatable modules during pretraining, and activates or ablates the modules at inference according to authorization. The threat is malicious fine-tuning after deployment (adversarial elicitation/finetuning): fine-tuning with 512 sequences per forgotten category (about 0.5M tokens) to recover removed capabilities; the authors say that with a larger budget, even data-filtered models may partially recover.

Questions
Dual-use capabilities leave model providers with an all-or-nothing choice: training separate filtering models per capability configuration costs grow linearly with the number of configurations, while methods such as refusal training, output filtering, and post-hoc unlearning, according to the paper, cannot robustly remove capabilities.
Methods
During pretraining, GRAM attaches several small auxiliary modules to each MLP block, and uses data labels to decide which modules are activated in the forward pass and which parameters are updated in the backward pass; at inference, ablating a module removes the corresponding capability, and a single training run supports multiple capability configurations.
Experiments and results
On Simple Stories and 800M dual-use data (virology, cybersecurity, nuclear physics, Lisp), the authors claim that GRAM's retention and removal are close to data filtering, and its resistance to malicious fine-tuning is better than MaxEnt-style post-hoc unlearning; in the 50M–5B Chinchilla scaling analysis, GRAM closely tracks the data filtering trend.
Limitations and future work
The limitations listed by the authors include: inability to cleanly separate entangled capabilities, no validation at frontier scale or in production environments, no explanation of the mechanism behind compositionality and the semi-annotation advantage, no examination of interactions with instruction tuning/RLHF, and evaluation using only cross-entropy loss.
Experimental setupGRAM · Simple Stories、FineWeb-Edu et al. · Compute Ratio (Core/Retain/Forget/Elicited Forget)
Evaluated models
GRAM
Benchmarks
Simple StoriesFineWeb-EduThe StackarXivEurope PMC (virology)OSTI (nuclear)
Metrics
Compute Ratio (Core/Retain/Forget/Elicited Forget)
AI summaryThe paper proposes a modular pretraining method, GRAM, which specializes auxiliary modules added to a neural network through selective updates; removing the modules at inference time removes the corresponding capabilities, thereby providing access control for dual-use AI capabilities. The authors test on synthetic stories and dual-use data including virology, cybersecurity, nuclear physics and specialized code, and report that the method can disable target capabilities while retaining the rest, and is more resistant to fine-tuning recovery than post-hoc unlearning. Scaling analysis from 50M to 5B parameters shows that on removed capabilities the gap between the data-filtered model and the full-data model grows with scale, while on retained capabilities the gap is smaller, with GRAM performing close to data filtering. Its training cost is independent of the number of supported capability configurations, and is 5 times lower than data filtering at 5 configurations.

The paper proposes a modular pretraining method, GRAM, which specializes auxiliary modules added to a neural network through selective updates; removing the modules at inference time removes the corresponding capabilities, thereby providing access control for dual-use AI capabilities. The authors test on synthetic stories and dual-use data including virology, cybersecurity, nuclear physics and specialized code, and report that the method can disable target capabilities while retaining the rest, and is more resistant to fine-tuning recovery than post-hoc unlearning. Scaling analysis from 50M to 5B parameters shows that on removed capabilities the gap between the data-filtered model and the full-data model grows with scale, while on retained capabilities the gap is smaller, with GRAM performing close to data filtering. Its training cost is independent of the number of supported capability configurations, and is 5 times lower than data filtering at 5 configurations.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to obtain, from a single pretraining run, a model whose capabilities can be trimmed on demand, enabling access control over dual-use capabilities at low cost.

    Core problem: access control for dual-use capabilities. The same capability can both cure disease and build weapons; if model providers do not differentiate access, they face an all-or-nothing "dual-use dilemma."

    • The ideal standard and its cost: The authors consider the gold standard to be providing different capability configurations to different users, obtained by training separately with data filtering for each configuration; a filtered model has never seen the relevant data and can therefore resist fine-tuning-based adversarial elicitation. But supporting N capability configurations requires training and deploying N models, which the authors say is prohibitively costly at frontier scale.
    • Shortcomings of existing cheap alternatives (per the paper): Refusal training, output filtering, and classifiers only restrict outputs while retaining the underlying capability, and are susceptible to adversarial elicitation; post-hoc unlearning requires only a small number of samples for fine-tuning to restore the removed capability; model branching still requires multiple deployments; LoRA-style parameter-efficient fine-tuning may lack the capacity needed to learn capabilities at pretraining scale.
    • The paper's core idea: During pretraining, route gradients to different modules according to data labels, so that capabilities are isolated into ablatable structures; at inference time, ablating a module approximates a model that has never seen that data.
    • The method proposed by the paper: gradient-routed auxiliary modules (GRAM), a pretraining method that supports multiple capability configurations in a single training run, with training cost independent of the number of configurations; the authors claim a 5× training cost saving relative to data filtering in a 5-configuration setting.

    Threat model (defender's perspective; the paper does not use terms such as black-box):

    • Defender's goal: provide different capability configurations according to deployment trust level, with removed capabilities unrecoverable.
    • Attacker's goal: restore removed dual-use capabilities through malicious fine-tuning.
    • Attacker's capability: fine-tune with 512 sequences (about 0.5M tokens) for each forgotten category; the authors describe this as a limited-budget adversary, and note that under larger budgets even data-filtered models may be partially restored.
    • Victim system: the deployed pretrained model with capabilities trimmed (including open-weight release scenarios).
  2. What related research exists?

    Related work is divided into four groups: data filtering, modular training, continual learning, and knowledge localization methods parallel to GRAM.

    Data filtering achieves robust capability removal

    • O'Brien et al. (2025)—evaluated pretraining data filtering on open-weight models and obtained capability removal that resists adversarial elicitation; Chen et al. (2025b) claim that data filtering can effectively remove harmful information related to CBRN weapons.
    • Birhane et al. (2023), Longpre et al. (2024), etc.—data filtering can remove undesirable traits such as toxicity. The paper notes that the pretraining cost of such methods grows linearly with the number of capability configurations.

    Modular training

    • DEMix (Gururangan et al., 2022)—each expert corresponds to a domain and is activated by domain; the paper notes that its symmetric expert sizes and lack of a shared core perform poorly under class imbalance (the experiments in Appendix A of this paper also report this).
    • Ghosal et al. (2026) (parallel work)—uses sparse masks to localize knowledge into ablatable parameters; the paper notes the difference is that GRAM uses pas to prevent gradients from forget data from reaching shared parameters, and this paper evaluates a few broad capabilities with compute-optimal scaling, whereas that work isolates a large number of individual facts at a single scale.
    • Wang et al. (2024), Golechha et al. (2025)—induce modularity without supervision; the paper notes that the former relies on emergent expert specialization and the latter reports no task specialization emerged, whereas GRAM uses supervised routing plus asymmetric module sizes and an always-on core.

    Continual learning and parameter-efficient adaptation

    • Continual learning methods (PackNet, Progressive Neural Networks, etc.)—according to the paper, their setting is that data arrives sequentially, whereas this paper's setting has all data available during training, and the goal is to produce multiple capability configurations from a single pretrained model.
    • Continued pre-training (Xie et al., 2024; Guo et al., 2025) and LoRA (Hu et al., 2022)—this paper evaluates both as baselines.

    Baselines and benchmarks: the compared methods are data filtering (Filtering), FT-LoRA, FT-Full, MaxEnt (post-hoc unlearning, Yuan et al., 2025), and DEMix (synthetic experiments only); the benchmarks are the Simple Stories synthetic dataset and a self-built 800M dual-use data mixture (FineWeb-Edu, The Stack, arXiv, Europe PMC, OSTI).

    The authors position this paper as: combining domain-specific modules, data-dependent selective gradient updates (Cloud et al., 2024), and independent optimizers for parameter subsets (Shilov et al., 2025), approximating multiple data filtering models in a single training run, and extending the Pareto frontier of capability shaping to a systematic comparison at 50M–5B scale.

  3. How does the paper address this problem?

    GRAM controls each module's forward activation and backward update according to data labels, isolating capabilities into small modules that can be ablated.

    Overall idea: on each MLP block of a dense Transformer, several small auxiliary MLP modules are connected in parallel; during training, the batch data labels determine which modules participate in the forward pass and which parameters receive gradients; at inference, ablating a module removes the corresponding capability. The method is named gradient-routed auxiliary modules (GRAM).

    Problem setting and metrics

    • The dataset is divided into a core dataset D1 and N−1 auxiliary capability datasets; a capability configuration S specifies which capabilities are retained, and the forget set F is the capability to be restricted.
    • Goal: for each configuration S, produce a model MS such that it has low loss on the retain set and high loss on the forget set; the total compute budget for all configurations is fixed to a single baseline training run.
    • The core metric is the compute ratio: CR(M, Di) = Li−1(ℓ(M, Di)) / Li−1(ℓ(MBL, Di)), i.e., the fraction of baseline training compute required to reach the same loss; the ideal value is ≥1 on the retain set and 0 on the forget set. The aggregate metrics are Core (CRC), Retain (CRR), and Forget (CRF).

    Architecture

    • Each GRAM layer contains a core MLP with the same width as the baseline MLP and N−1 smaller auxiliary modules (in the realistic setting, auxiliary module width is 10% of the core MLP).
    • The layer output is a weighted sum of the module outputs: hout = ∑i=1N mi Ei(hin), where m is a binary indicator vector and the core module is always active.
    • Unlike MoE, GRAM has no learned router and no per-token routing; routing is determined by data labels.

    Gradient routing

    • Parameters are partitioned into one core set (shared parameters such as embeddings, attention, normalization, and the core MLP) and N−1 disjoint auxiliary sets, each using an independent AdamW optimizer (following Shilov et al., 2025).
    • Core batches: the core MLP is always active; with probability pcr one auxiliary module is additionally activated at random, and all active parameters are updated, making core performance robust to whether modules are active.
    • Auxiliary batches: the forward pass activates the core MLP and the corresponding auxiliary module i; the backward pass always updates module i, and core parameters are updated with probability pas—the larger pas is, the stronger the capability but the weaker the modularity.
    • paf(i) controls the sampling frequency of each auxiliary dataset; when oversampling, D1 is correspondingly undersampled to keep compute equal to the baseline.

    Inference and capability control

    • When serving capability configuration S, the core MLP and the auxiliary modules in S are activated, and the remaining modules are ablated.
    • Appendix N reports that module forward weights can be continuously scaled between 0 and 1, enabling partial capability exposure.

    Success criterion (Elicited Forget)

    • To test whether a capability is removed rather than suppressed, for each forget category the model is fine-tuned on 512 sequences (about 0.5M tokens), the checkpoint with the lowest validation loss is taken, and Elicited Forget is then computed in the same way as CRF; a lower compute ratio after fine-tuning indicates more robust removal.
    • This budget is kept consistent across model sizes and methods; the authors claim this simulates an adversary with limited capability.
  4. What experiments did the paper conduct?

    Three sets of experiments: Simple Stories synthetic validation, the 800M dual-use data main experiment, and Chinchilla scaling analysis from 50M–5B.

    Experimental setup

    • Models tested: the Simple Stories setting is an 8-layer 26M Transformer; the realistic dual-use setting is a 24-layer approximately 800M Transformer; the scaling analysis covers 7 sizes: 50M, 100M, 200M, 400M, 800M, 2B, and 5B (Chinchilla-optimal, with auxiliary data fixed at 1% of core data).
    • Datasets: Simple Stories (about 2M children's stories, 48 topics, 4 used as auxiliary capabilities); the core of the realistic setting is FineWeb-Edu + general arXiv papers + non-Lisp code (16B tokens), and the auxiliary sets are Lisp code, virology (Europe PMC), nuclear physics (OSTI/arXiv), and cybersecurity (arXiv), each about 40M tokens (Table 2).
    • Baselines: Baseline (trained on all data, compute ratio fixed at 1), Filtering (a data filtering model trained separately for each configuration), FT-LoRA, FT-Full, MaxEnt (post-hoc unlearning); DEMix is evaluated only in the synthetic experiments.
    • Metrics: four compute ratios: Core/Retain/Forget/Elicited Forget; except for Filtering, all methods use the same training FLOPS as the baseline.
    • Repeats: except for 2B and 5B, which are single runs only, all are N=3 random seeds, reporting 90% confidence intervals.
    • Evaluation method: no LLM or human review; all compute ratios are converted from validation cross-entropy loss.

    Main results

    800M realistic dual-use setting, mean over 5 capability configurations for each method (according to Figure 4 and the main text):

    Swipe horizontally to read the table

    MethodCore ↑Retain ↑Forget ↓Elicit ↓Training FLOPSTotal parameters
    Filtering0.990.960.530.585×5×
    GRAM0.820.970.540.631×1.4×
    FT-LoRA0.950.980.510.561×1.4×
    FT-Full0.960.950.520.571×5×
    MaxEnt0.880.890.460.981×5×
    • The authors claim that GRAM and FT-LoRA are close to data filtering on Core, Retain, and Forget, with at most about 10% more active parameters; FT-Full performs similarly but requires deploying multiple models.
    • MaxEnt has the lowest Forget but an Elicit of 0.98; the authors claim that most of the degradation it causes is reversed by fine-tuning, i.e., the capability is not robustly removed.
    • The authors note that this setting (little auxiliary data, single training round) favors low-rank adaptation, and that FT-LoRA may not be competitive with a longer fine-tuning phase.

    Simple Stories synthetic validation

    • On the 26M model, GRAM's Retain is 0.952 and Core is 0.938, close to Filtering's 0.962/0.961 (Table 1); Figure 2 shows that under five configurations, retained capabilities are close to the baseline and forgotten capabilities are below the baseline (e.g., for forget category A Deadline or Time Limit: Filtering 0.65, GRAM 0.61).
    • Resistance to elicitation: GRAM's Elicited Forget is 0.855, close to Filtering's 0.870; MaxEnt is 0.983, almost fully recovered (Table 1).
    • Exception: DEMix lags across the board (Core 0.248, Retain 0.183), which the authors attribute to the lack of a shared core, causing each expert to relearn basic language structure.

    Compositionality and semi-labeling

    • Arbitrary subset combinations: Figure 5 shows that when only virology is retained vs. all modules activated (a configuration not seen in training), GRAM's virology compute ratio is higher in both cases, whereas FT-LoRA's compute ratio worsens for all categories when all adapters are activated; the authors claim that GRAM achieves compositionality despite never being trained with all modules activated.
    • 50% semi-labeling (400M, realistic setting): GRAM's Forget is 0.60 ± 0.01, lower than Filtering and FT-LoRA's 0.85 ± 0.01, and Core is 0.96 (Figure 6); the authors claim this is consistent with the absorption effect of gradient routing, and the mechanism is left for future work.

    Scaling analysis (50M–5B)

    • Figure 7: as scale increases, data filtering's Forget compute ratio decreases and resistance to fine-tuning strengthens; the authors speculate that at small scale, much of the baseline's loss reduction on the forget domain comes from transferable general language structure.
    • GRAM and FT-LoRA closely track the data filtering curve at all scales, while amortized training compute is only one fifth of filtering.
    • Exception: GRAM's Retain at 5B deviates upward from the trend; the authors attribute this to switching to heterogeneous gradient accumulation at 5B without correspondingly lowering the auxiliary factor paf (Appendix H), and mark the estimated corrected value with a dashed line in the figure.

    Other ablations and analyses

    • Number of auxiliary capabilities (Simple Stories, 4→20): Core stays flat at about 0.88, Retain about 0.89–0.91, Forget about 0.65–0.74, Elicit about 0.71–0.84, and separation is maintained (Appendix D).
    • Architecture ablation (100M): GRAM(MLP) and GRAM(LoRA), and FT-MLP and FT-LoRA, are each close to their counterparts; the authors claim the difference comes from the training method rather than the module architecture (Figure 9).
    • pas sweep: as pas goes from 0 to 1, Core goes 0.90→0.97, Retain 0.88→1.04, Forget 0.69→0.89, trading off isolation against shared representation quality (Figure 11).
    • pcr sweep: at pcr = 1, the core performance of ablated configurations drops to 0.79; the authors recommend an intermediate value (Figure 10).
    • Heterogeneous gradient accumulation (200M, single seed): GRAM's Core goes 0.94→0.99, Retain 0.75→1.11, and Forget is essentially unchanged (Table 4).
  5. What are some points that can be further explored?

    The authors list six limitations, covering capability entanglement, scale validation, mechanistic explanation, and evaluation metrics; the experiments cover up to 5B scale and four dual-use domains.

    Limitations and future directions noted by the authors

    • Capability entanglement: when the target capability and the desired capability overlap heavily, no method may be able to cleanly separate them (Section 8, Limitations (i)).
    • Scale and production validation: scaling trends were only validated up to 5B parameters, and it was not verified whether they extend to frontier scale or hold in production environments (Limitations (ii)).
    • Engineering complexity: implementing GRAM in production requires substantial engineering effort and introduces complexity, which frontier developers may be unwilling to bear (Limitations (iii)).
    • Missing mechanistic explanation: it remains unclear why GRAM composes capabilities more reliably than FT-LoRA, whether the explanation of the absorption effect of the semi-annotation advantage withstands direct testing, and whether these advantages extend beyond the scope studied in this paper (Limitations (iv)).
    • Interaction with post-training: it is unknown how these methods interact with instruction tuning or RLHF; post-training may reinforce or erode the capability separation established during pretraining (Limitations (v)).
    • Evaluation metric: evaluation used only cross-entropy loss, which the authors say, although a strong predictor of downstream performance, may be incomplete (Limitations (vi)).

    Scope of experiments

    • The models tested are decoder-only Transformers trained by the authors, totaling 26M (Simple Stories) and seven scales from 50M–5B (realistic setting); no other architectures or released models were involved.
    • The dual-use domains are four categories: virology, cybersecurity, nuclear physics, and Lisp code; auxiliary data is fixed at 1% of core data (about 40M tokens per category, at 800M scale).
    • The adversarial elicitation evaluation is fixed at a fine-tuning budget of 512 sequences (about 0.5M tokens) per forgotten category; the authors explicitly state that partial restoration may occur under larger budgets, and did not evaluate larger budgets or other elicitation methods.
    • Defense comparisons cover data filtering, FT-LoRA, FT-Full, and MaxEnt; DEMix was evaluated only in the Simple Stories setting.
    • The 2B and 5B scales were run only once (no confidence intervals); the scaling experiments at 400M and 800M used uniform gradient accumulation, and the authors say GRAM's Retain values there may be slightly underestimated (Appendix H).
  6. Summarize the main content of the paper

    GRAM uses gradient routing to isolate capabilities in a single pretraining run; the authors claim it approaches data filtering and that cost does not grow with the number of configurations.

    A paper on a pretraining method for access control of dual-use capabilities: addressing the problem that "training data-filtered models separately costs grow linearly with the number of configurations," it proposes gradient-routed auxiliary modules (GRAM).

    • Method: In parallel with each MLP block of the Transformer, small auxiliary modules are added, with forward activation and backward updates controlled by data labels (core parameters receive gradients from auxiliary batches with probability pas, and auxiliary modules are randomly activated on core batches with probability pcr); at inference, ablating the modules removes the capability, and module weights can also be continuously scaled between 0 and 1.
    • Synthetic validation: On the Simple Stories 26M model, GRAM's Retain computation of 0.952 is close to data filtering's 0.962, and Elicited Forget of 0.855 is close to filtering's 0.870, while post-hoc unlearning MaxEnt reaches 0.983 (Table 1).
    • Realistic dual-use setting: With an 800M model and four domains—virology/cybersecurity/nuclear physics/Lisp—GRAM and FT-LoRA are close to data filtering on Core/Retain/Forget, with training FLOPS the same as the baseline while filtering requires 5×; MaxEnt's forgetting is largely recovered after fine-tuning (Elicit 0.98, Figure 4).
    • Compositionality and semi-labeling: GRAM supports arbitrary combinations of modules not seen during training without degrading retained performance, while FT-LoRA degrades when multiple adapters are stacked; under 50% semi-labeling, GRAM's Forget is 0.60 ± 0.01, better than filtering and FT-LoRA's 0.85 ± 0.01 (Figure 6).
    • Scaling: In a Chinchilla-optimal analysis from 50M to 5B, data filtering's forgetting and resistance to elicitation strengthen with scale, and GRAM and FT-LoRA closely track its curve throughout (Figure 7); the authors say GRAM's training cost is independent of the number of configurations, saving 5× over data filtering at 5 configurations.
    • Authors' conclusion: The authors consider GRAM a possible step toward robust access control, and note that their results also establish that data filtering itself scales favorably with scale; limitations include capability entanglement, unverified frontier scale, lack of mechanistic explanation, and evaluation using cross-entropy only.

Related papers

Read originalICML 2026