PolicyMem stores language model rules as reusable geometric memories
PolicyMem: Geometric Policy Memory for LLM Governance
Computation and LanguageArtificial Intelligence
Summary
Large language models need ways to stay safe and follow rules when answering questions. Existing methods either rely on trained models or require lots of manual setup, making consistent rule use hard. The authors propose PolicyMem, a system that turns written rules into reusable geometric objects in a shared space, allowing the model to detect, rewrite, and verify responses against these rules efficiently. This makes the model's safety checks easier to manage and more consistent across different tasks.
What this means in practice
- •For ai safety engineers: Use geometric policy memory to detect unsafe responses and verify policy compliance in deployed language models automatically.
- •For chatbot platform developers: Integrate a shared policy memory to enable consistent rewriting and post-response verification without retraining models for each policy update.
Authors
Yuanchen Bei, Zhengzhang Chen, Yanjun Zhao, Haoyu Wang, Hanghang Tong, Haifeng Chen
Abstract
As large language models (LLMs) are increasingly deployed in real-world high-stakes applications, effective governance has become essential. Existing safeguards largely follow two paradigms: learning-based guards provide strong semantic discrimination but couple policy behavior to trained models and taxonomies, while programmable frameworks offer flexible control but require substantial manual prompt and workflow engineering. Neither externalizes policies as reusable operational states, making it difficult to consistently reuse policy evidence across detection, intervention, and verification. In this paper, we introduce PolicyMem, a geometric policy memory that externalizes natural-language policies as reusable geometric memory objects represented by low-rank subspaces in a shared representation space. A memory writer compiles natural-language policies into policy memory slots, and query-response pairs read the policy memory through projection energy. The resulting policy-evidence profile directly mediates the safety verdict and is reused for policy attribution and post-intervention verification. Coupled with a response rewriter, PolicyMem enables a detect-rewrite-verify loop for LLM governance. Across five widely used benchmarks, PolicyMem achieves state-of-the-art unsafe behavior detection while enabling effective policy attribution, rewriting, and post-intervention verification through the shared policy memory.