Non-Singular

A Miller-Rabin Test for Alignment

Valentin Hartmann and Clément Hongler

Most current alignment tests have the following shape:

  1. Choose a set of inputs that seem like they might elicit misaligned behavior.
  2. Feed them to the model.
  3. Check whether the model’s outputs or internals show signs of misaligned behavior.

But models that look aligned under testing can still take misaligned actions in untested situations.1 What we need is a formal guarantee: knowing that a misaligned model is very unlikely to pass our suite of tests, in a quantifiable way.

Probabilistic Primality Testing

The idea is the same as that of probabilistic primality testing. You can determine whether a number nn is prime by checking all possible divisors up to n\sqrt{n}. But this becomes impractical for large nn. Likewise, checking a model’s behavior on every possible input is not feasible in practice. Is there a way to carefully design tests that can give us rigorous guarantees without exhaustive checking?

Randomization gives us a tool for this. Randomized primality tests like Miller-Rabin or Solovay-Strassen create a sequence of carefully chosen random tests for nn. If nn fails any of these tests, it is guaranteed to not be a prime. If it succeeds at a test, we don’t know whether it is a prime or not; composite numbers can get lucky and slip through. However, this becomes increasingly unlikely: for Miller-Rabin, the likelihood that a composite number passes kk independently sampled tests is at most 4−k4^{-k}. What the guarantee says is that our tests are really good: If nn is composite and we perform just a few tests on it, we are very certain that at least one of them will flag the fact that nn is not prime. This guarantee is substantially better than what we would get from randomly checking divisors between 2 and n\sqrt{n}; with a smart choice of tests you can hence make the testing much more efficient.

What we want is the same kind of guarantee for the alignment of a model: a sequence of tests we can perform so that a misaligned model is very unlikely to pass all of them. Constructing the right sequence of tests and proving such a guarantee might be very hard. But LLMs are getting very good at math very quickly and we could delegate this work to them.

The Theorem We Want

We have models M1M_1 and M2M_2, with M1M_1 being very capable at math and M2M_2 being the model we want to evaluate and which was trained with a known training process. M1M_1 might be different from M2M_2 and more capable at math, but ideally we want M1=M2M_1 = M_2.

Our goal is to construct tests for a specified property, together with a proof that a model violating that property has only a small probability of passing. The property would be a mathematical formalization of something we care about for alignment.2

The shape of the theorem would be as follows:

  • Let MM be a model trained with training process QQ
  • Assumptions about QQ such as the pretraining distribution, the type and order of RL tasks, …
  • Assumptions about MM such as about its architecture, the output sampling mechanism, …
  • Passing criteria for MM’s (internal or output) behavior on a set of inputs that was constructed in a certain way
  • Passing criteria for MM’s weights
  • A small upper bound on the probability that a model produced by QQ passes all the criteria despite violating the specified property. This probability is over the training process and all randomness in the testing procedure, including input selection and output sampling.

Instead of defining passing criteria just for MM and samples of MM’s behavior, we could also define such criteria for the weights and behavior of checkpoints along the training trajectory of MM.

Importantly, this theorem is a guarantee about the ability of the tests to catch a model that violates the alignment property. It does not, by itself, give the probability that a model violates the property conditional on having passed.

The human provides the property that we want to ensure. M1M_1 provides:

  • The assumptions about QQ and MM
  • The tests and corresponding passing criteria
  • The proof of the theorem

We require M1M_1 to provide a formally checkable proof (for example in Lean), and assumptions and tests whose applicability to M2M_2 and its training process can be independently checked. The resulting guarantee would then hold even if M1M_1 were misaligned.3

The Research Question

Under what tractable, independently checkable assumptions about a model and its training would a violation of an alignment-relevant property necessarily leave evidence that randomized tests can find? Could increasingly capable mathematical models help us discover those assumptions, tests, and proofs?

Footnotes

  1. https://www.lesswrong.com/posts/Zu5wmhtxJCfrXQY8H/our-most-aligned-model-yet ↩︎

  2. We deliberately leave this vague; mathematically formalizing properties that ensure alignment with respect to certain values or goals is a hard problem in itself. A toy example would be to ensure that, for inputs drawn from a specified distribution, the probability of the model producing a particular string is at most ε\varepsilon. ↩︎

  3. A misaligned M1M_1 could still obstruct the project by deliberately failing at the task it is given, though. ↩︎

← all posts