cs.CLSep 19, 2026

Directing large language models to follow the letter or spirit of the law

Authors: Peng Qian, Andrew Li, Sam Chen, Sonia K. Murthy, Yonatan Belinkov, Tomer D. Ullman

Organizations: Department of Psychology, Harvard University · Kempner Institute for the Study of Natural and Artificial Intelligence, Harvard University · Taub Faculty of Computer Science, Technion — Israel Institute of Technology

Abstract

The distinction between the spirit and letter of the law is a central issue across research and everyday life, and a growing concern for building safe, intelligent machines. What is this distinction based on, and how can we develop machines that follow the intention behind a rule? We used targeted adaptation that made large language models prioritize the spirit or letter of the law. With minimal modifications, our method significantly changed LLM behavior across diverse measures, novel vignettes, real-world scenarios, and influential legal cases. An analysis of model internals revealed a low-dimensional space with three interpretable dimensions matching a formal pre-specified framework for the geometry of legal concepts. These findings show how legal thought in LLMs may be organized and directed.

Figures & tables

Explore similar work

CardsList
  1. Know Your Limits : On the Faithfulness of LLMs as Solvers and Autoformalizers in Legal Reasoning

    Jun 15, 2026Olivia Peiyu Wang, Sanna Wong-Toropainen, Daneshvar Amrollahi +4LLM ReliabilityAutoformalization

  2. How Do LLMs Understand Legal Philosophy? Diagnosing Legal-Philosophical Reasoning in LLMs

    Oct 14, 2026Shuyuan Zheng, Yun-seo Lee, Xing Gao +7Legal ReasoningLLM Evaluation