Open weights models have many potential benefits, such as preventing gradual disempowerment, accelerating safety research, and accelerating defensive technology. However, they also create the potential for misuse as they can be fine-tuned and deployed without safeguards. It thus becomes critical to measure and predict how easy it would be for bad actors to misuse any particular model to weigh the risks against the benefits.
To address this problem, the field of unlearning tries the high-level approach of removing capabilities already present in the model, post-hoc. This approach is attractive because it does not require changes to the pretraining pipeline, making experimentation and eventual deployment much easier. However, while unlearning often successfully removes harmful behavior, it is not tamper resistant as the removed behavior remains easy to elicit through fine-tuning.
An alternative approach is to prevent harmful capabilities from being learned in the first place, which is generally significantly more robust to fine-tuning elicitation. However, these approaches require intervening on the pretraining pipeline, making experiments much more expensive.
This article presents experiments demonstrating that tamper resistance changes predictably with scale, opening up the possibility of doing experiments on pretraining interventions with significantly lower cost. Tamper resistance at each scale is measured using optimal fine-tuning hyperparameters for that scale, and these hyperparameters change predictably as well.
Defining tamper resistance
In these experiments, tamper resistance is defined as the # of fine-tuning tokens required to reach a specific harmful capability threshold. This article takes a specific interpretation for each aspect of this definition, and how predictably resistance scales with alternative definitions may be future work.
# of fine-tuning tokens is interpreted as the # of tokens with a single-epoch of data, which should be lower than if data were repeated based on prior studies. An alternative definition could use a fixed # of epochs (like Deep Ignorance using two epochs) or find the minimum # of tokens required to reach a certain loss given an arbitrary # of epochs. Future work could even combine these, predicting the # of tokens needed to reach a target loss for a given size (possibly even combining a data repetition parameter).
Harmful capability is defined as validation loss on a dataset of the harmful behavior. In prior work this dataset can either be the harmful data filtered out of the pretraining corpus (Team Shard’s work) or an external harmful dataset (token-level filtering), and this article tests both cases. An alternative definition can be based on sampling-based benchmark evals (like Deep Ignorance does). These experiments use loss to have cleaner scaling laws, similar to LoRA Without Regret, and motivated by the fact that loss is significantly correlated with benchmark performance.
The threshold of harmful capability is defined as the capability exhibited by a baseline model (a model without the tamper resistance intervention) of the same size. This matches the definition in Deep Ignorance and token-level filtering. An alternative definition can be a specific fixed capability, but this is much harder to make scaling laws for. As a variation, we try defining it by a baseline model of the same general loss, which improves the predictability of the fit.
Scaling methodology
Pretraining ladder
The experiments use a ladder of pretrained models from 1M to 1B parameters with RoPE, SwiGLU, RMSNorm, full attention, and Muon. Step Law is used to fit batch size and LR and IsoFLOPs for the training horizon.
Fine-tuning elicitation across scales
At each model scale, we fine-tune the models to the loss threshold to elicit their internal harmful capabilities, measuring the # of tokens required to reach the threshold. The # of tokens differs significantly based on the hyperparameters used during fine-tuning, so it is crucial to use the optimal values to get a realistic measurement. To do this, we do a 5x5 sweep across learning rate and batch size with step sizes of 2x. For increased accuracy and reduced noise, we fit a paraboloid to the values and use the paraboloid min as the measured resistance instead of the grid min.
Fitting tokens instead of loss
The 5x5 size and paraboloid fit match the procedure for fitting the pretraining learning rate and batch size. The main difference is that the z-axis is the # of tokens rather than the pretraining loss, and these have different dynamics. First, since the # of tokens spans a far greater range of magnitudes than loss, taking the log over it is important for stability. This log is principled from an intuitive argument as well, as log loss is predicted from log tokens, not tokens, in a standard pretraining scaling law (footnote: in my view the pretraining fit should use log loss instead of loss, but the two are nearly identical since loss barely changes in magnitude which is perhaps why it didn’t catch on). Secondly, tokens have far more noise than loss because loss decreases so slowly as it approaches the loss threshold. Due to this, we empirically need to use a step size is 2x instead of sqrt(2)x to consistently get well-behaved paraboloid fits.
Fractional batch sizes
Another difference between pretraining and fine-tuning is that the optimal batch size is much lower, to the point where the sweep sometimes goes below batch size 1. Note that fine-tuning elicitation is done without learning rate decay because the # of steps is not known ahead of time, which also contributes to a lower optimal learning rate. In order to handle this, we use fractional batch sizes.
[diagram showing the different designs]
There are a few different designs that are possible. The most straightforward is to take a prefix of each batch, but this systematically undertrains long context abilities. Another option is to partition each batch into sub-batches and train on them consecutively, but this creates correlations across steps. Thus, we partition batches and then shuffle the sub-batches uniformly to resolve both these issues. This does mean the order of sequences for fractional batches is different from that of full batches, but empirically the token landscape changes smoothly when transitioning from full to fractional batches.
Tamper resistance scales predictably
Under the definition above, tamper resistance increases predictably with model size in a power law. The smoothness implies that the benefits of data filtering do not require “complex enough circuits”, as one intuition might be. Even starting from 3M parameters, the efficacy of filtering already has a continuous effect. These spiritually line up with recent results from Goodfire as well, which find that neuron meanings form in a continuous manner with scale instead of exhibiting a discontinuity.
On the fact that resistance increases with scale, two opposing forces can be imagined here: larger models are more sample efficient so should learn faster, but the larger baseline model has lower loss on the harmful domain so the loss threshold is lower. Empirically, the second force seems to overcome the first. Another definition of tamper resistance would keep the threshold fixed, which would likely show decreasing resistance with scale. However, this definition is difficult to build a scaling law for because there is no good way to select this threshold. If the loss threshold is too high, larger models may be below it even without fine-tuning. If it’s too low, it may be impossible for smaller models to reach. A better approach may be a law that predicts the # of tokens required to reach a desired loss from a desired scale.
[diagram showing data reordering intuition?]
The left plot shows the results when the harmful capability is defined using the filtered out data itself. Thus, the result may be intuitively expected by viewing the fine-tuning step as continued pretraining with data reordering and observing that the amount of data being reordered increases with scale. However, the right plot shows the results when the harmful capability is defined using an external dataset. Even in this case, the qualitative result of tamper resistance increasing with scale holds. Notably though, the absolute numbers in the right plot are about two orders of magnitude smaller than in the left plot.
Percentage vs. absolute scaling
In addition to the absolute # of resistance tokens, another interesting metric is the resistance tokens as a % of the pretraining tokens. In these plots, the loss threshold is set using a baseline model of the same size rather than a baseline model of the same loss, as this makes reasoning about the # of pretraining tokens more straightforward.
For harmful capability as filtered out data, the % seems to stay about the same. With the data reordering intuition, this makes sense, since the number of tokens of delta between the baseline and filtered model is always a constant % of the pretraining tokens. Notably, the %s do not match, with 8% of the data being filtered out but only 2% required to match the same capability. This may be due to the increased sample efficiency of the model, making it more efficient to train on the data at the end (todo: maybe there’s data reordering research on this, also note that the lack of loss decay should make this go the other way).
For harmful capability as downstream data, the % seems to decrease. This result seems less expected ahead of time but has intuitive backing. In this case above, the delta between the baseline and filtered model is the same as the delta between the filtered model before and after fine-tuning: extra filtered out data. However, for this case, these two deltas are no longer the same. The baseline model is trained on the filtered out data and has a certain loss on the downstream data, while the filtered model is directly trained on the downstream data to reach the baseline’s downstream loss. Thus, the filtered model is being trained on data that’s systematically more direct for the goal of reaching a certain downstream loss. Speculating on an explanation, the efficiency of training towards downstream loss using filtered out data may intuitively go down with more scale, because it is indirect and relies on “random hits” in an increasing possibility space.
Extrapolation error
With these scaling laws, it becomes feasible to extrapolate and predict the tamper resistance of much larger models without training them. As mentioned in the introduction, this can be used to quickly iterate on methods at smaller scales (especially with AI agents) or to answer scientific questions with much fewer resources. Additionally, it can be used to forecast policy implications of future open weights models, as the outlook may differ significantly based on the specific number of tokens required to reach a certain capability level. The latter can be enhanced with laws that take in the target capability level as an input, as mentioned above. (todo: parts of this section should probably be moved to the introduction).
The usefulness of scaling laws towards each of these ends is significantly influenced by its extrapolation accuracy. Unfortunately, even with the techniques described in the scaling methodology, the tamper resistance laws seem much less smooth than pretraining laws, perhaps due to the increased noise of the fine-tuning process and the high variance of the # of tokens compare to log loss. Despite this, the laws can make predictions with less than 20% error with a 10x model size scale up, which provides a lot of utility for the use cases.
[plot of 10x extrapolations to 100M, 200M, 500M, 1B]
The plot above shows various 10x extrapolations when harmful capability is downstream data. Extrapolation experiments were only done with harmful capability as downstream data for cost reasons as its fine-tuning runs are orders of magnitude shorter (the majority of the cost is in the fine-tuning grid, not the pretraining run). In each of these cases, the extrapolation error was less than 20%. In these plots, the loss threshold is set using a baseline model of the same loss rather than a baseline model of the same size, as this consistently increases R^2 and reduces extrapolation error.
Discussion
Smooth circuits
Before beginning this project, we were unsure whether small models would be sufficient for studying tamper resistance interventions. Intuitively, the model seems to be learning very different things at different scales as it changes from pattern-matching heuristics to genuine “reasoning” or “circuits” about the harmful domain, which may interact differently with filtering, unlearning, or fine-tuning elicitation. However, since resistance to elicitation changes smoothly across scales, it suggests that these two are not qualitatively different (as also suggested by pretraining scaling laws). This also lines up with Goodfire’s recent interpretability results, which find that the meanings of neuron changes smoothly with scale as opposed to having a phase change between “memorization” and “composition”. *effectiveness independent of wtv is happening with circuits
Technical use cases
*our scaling laws help tune and compare methods. active voice and shorter *by plotting scaling laws, a specific unlearning strength ($lambda=8$) gives the best tradeoff. then when you try it at a new scale, you can just reuse that value * mention cas's google doc. "scaling laws also provide additional insight" instead of "additional insight can be gained" * make pr for blog post on his website. will need markdown. some other style findingsThe most immediate use case of these scaling laws is in tuning methods and comparing between methods. Since methods or hyperparameters often affect benign capabilities in addition to harmful resistance, the comparison plot will generally have benign loss as the x-axis instead of model size. We have a forthcoming paper on applying unlearning during pretraining which does both of these. To briefly summarize, the method has an important hyperparameter controlling the strength of unlearning, and a scaling plot reveals that a specific value ($\lambda=8$) consistently gives the best benign-resistance tradeoff across scales. Once each method has been tuned, different methods can be compared side-by-side with the benign-resistance plot. This R&D can be done at far smaller scales than deployment, which is especially important for fast iteration with autoresearch.
Additionally, scientific questions can be studied at much smaller scales while still providing good signal for larger scales. For instance, as mentioned in open weights model safety ideas, the relative effectiveness of filtering in different domains can be tried. This post already did an early version of this, finding a ~100x difference in resistance between broad biology data and WMDP-Bio data. Further, additional insight can be gained from the scaling curve itself, outside of its ability to predict resistance for a larger model. For instance, this post finds that broad biology data maintains a stable % of resistance tokens (relative to pretraining tokens) while the % for WMDP-Bio goes down with scale. Perhaps the slope of tamper resistance is a better metric to report than the absolute tamper resistance at a certain scale.
Policy use cases
Policy is more effective when it is proactive instead of reactive, and extrapolating these scaling laws give some signal for this already. This post is only an initial step and doing this effectively will require many improvements, but we can get a view of where the gaps are. First, the relevant policy question is the # of tokens needed to reach a certain capability level, not the # needed to match a baseline of the same size. To accommodate this, the scaling law may be enhanced to take in both size and threshold as input, as mentioned in the results section. Also, since different datasets have very different resistance levels (as shown by ~100x difference in this post’s two datasets), the specific elicitation and evaluation datasets will need to be chosen with care. Additionally, this post uses dense models with standard attention, but different laws will need to be fit for different architectures, similar to the MoE scaling laws. Finally, while this post defines harmful capability with loss to have smoother scaling, it will be important to connect this loss to downstream harmful use, similar to existing papers connecting loss to evaluation performance.
With these improvements, we can begin to predict the # of tokens needed to reach certain harmful capability levels for existing and future projected model sizes. The specific # of elicitation tokens required may qualitatively change policy, up to and including motivating a ban on open weights models above a certain size (and giving a principled way of determining this size). Outside of a ban, the bottleneck to fine-tuning open weights models for harmful use cases will likely be data rather than compute, as mentioned in open weights model safety ideas. Unlike general-purpose compute, this data is highly specialized and is thus a good target for policy to limit (and such sensitive CBRN data should and is already limited by existing policies, outside of considerations around open weights models).