Language models learn facts more compactly from weights than notes

Specification Oracles

Machine Learning

Summary

Specifications need to balance between being too vague or too detailed. The authors explored if language models can act like smart oracles that answer questions by learning facts directly. They tested two ways to store these facts: writing them down as notes or embedding them in the model's internal settings (weights). They found that storing facts in the model’s weights worked better when the information had clear structure but required more storage space. Using external note sheets used less space but didn’t benefit as much from structured information.

What this means in practice

  • For software developers: Create compact interactive specification oracles that store structured facts in model weights to answer technical queries accurately.
  • For technical writers: Use external note-based oracles to keep specifications concise and answer questions with minimal storage overhead.

Authors

Atticus Cull, Justin McCarthy

Abstract

Specifications face a basic tradeoff: leave details out, and important questions go unanswered; record every detail separately, and the specification becomes large and prolix. We investigate whether a language model can serve as a compact, living specification oracle by learning facts about a target and answering questions about it directly. We compare two ways of storing the learned facts: external text notes and changes to the model's weights. Across four families of 596-fact worlds and two Qwen2.5 model sizes, weight-only oracles benefited substantially more from structure: with the 7B model, their accuracy integrated across storage capacities was 18.5 percentage points higher on structured than unstructured worlds, compared with 1.1 points for note-sheet oracles. This advantage came at a substantial storage cost, with the smallest adapter requiring approximately 175 KiB compared with a maximum note budget of 16 KiB. Adapted weights therefore exploited latent structure more successfully, while external notes required substantially less object-specific storage.