Consociational codification

Aligning the model to local rules

The norms and legal rules of one country, region, language, online forum, or statute are assembled into an explicit rule set. The rule set is converted into training data, which is used to tune either the assistant itself or a separate checker beside it. As a result, the same input gets a different verdict depending on whose rules apply, and the system can name the rule it applied. The rule sets come from human-verified cultural norms across 50 countries, jurisdiction-specific legal texts across 14 languages, region-targeted generated data for Southeast Asia, and privacy statutes turned into synthetic scenarios. PluRule tests the resulting skill directly. It asks a model which of 2,885 forum rules a comment breaks, and finds that frontier models perform barely above a trivial baseline. What unites this approach is the pipeline (a local rule set, data generated from it, and a model trained on that data). Whether the assistant is tuned or a separate checker is added is a secondary choice.

The method (highlighting differences with Consociational codification)

Scroll the diagram sideways to see all of it.

Use it in codefrom aiag.codified import ChoiceOfLaw
from aiag import LM
from aiag.codified import ChoiceOfLaw

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
clause = lambda case: (case["customer in"], f"the customer is in {case['customer in']}")  # whose rules govern
policies = {"Germany": "Beer and wine may be sold from age 16.", "US": "Alcohol may be sold only from age 21."}
law = ChoiceOfLaw(policies, clause)

case = {"customer in": "US", "server in": "Germany"}
law(case)  # -> ('US', 'the customer is in US')
reply = law.wrap(lm, case).chat("I'm 19. Can I order a beer with dinner?")  # answered under US rules

pip install aiagEvery method in aiag Library on GitHub

Concept Analysis: Theoretical Foundations

Each concept is read twice: whether the approach carries it over, and whether the approach's own sources claim it. A concept that the approach claims but does not carry over is a shortfall. A concept that it neither claims nor carries over is an omission, which marks a gap in the field rather than a failure of the work.

Segmental autonomy

PresentClaimed · preserved

Definition (Arend Lijphart, Democracy in Plural Societies, 1977)

In a deeply divided society, each group governs its own internal affairs (e.g., its schools and its family law) within its own sphere, instead of everyone living under one uniform rule.

Analysis

Each region's cultural norms and legal policies govern the answers given in that region, across 50 countries and 493 regions. The norms were verified by humans rather than inferred. This is the only built system in the encyclopedia in which the user's sphere determines the rule applied to them.

Choice-of-law rule

PartialShortfall · partially preserved

Definition (Friedrich Carl von Savigny, System of the Modern Roman Law, 1849)

When several bodies of rules could govern the same case, an explicit rule decides which one actually does and states the reason. Without such a rule, "different rules for different groups" gives no answer for the cases that fall between groups.

Analysis

The system states which norm it applied and cites it. This is half of Savigny's requirement and more than “Law as an objective the model cannot override” achieves. The missing half is the case in between. A query that involves two countries' norms has no allocation rule, because the system reads the geography off the query rather than reasoning about it.

Mutual veto and proportionality

AbsentOmission

Definition (Arend Lijphart, Democracy in Plural Societies, 1977)

Decisions that affect all groups require every group's consent, and representation is proportional to each group's size. As a result, no segment can simply be outvoted on what matters most to it.

Analysis

Norms are collected from regions and compiled into training data. No region consents to this compilation, and none can veto how it is represented. Representation also follows the availability of documented norms rather than population.

Concept Analysis: Newly Introduced

The choice-of-law clause stated in the answer

Added

Savigny's rule operates between courts, out of view of the parties. Here, the governing norm is named in the model's response to the user, so the allocation is visible at the moment it is applied. Nothing in the tradition shows the conflicts rule to the person it governs.

Papers

arXiv:2412.06483MethodBuiltAuthority: External institution (open)

Builds a benchmark of 2,342 queries grounded in human-verified cultural norms and legal policies from 50 countries and 493 regions or ethnic groups. It then trains SafeWorldLM with direct preference optimization to answer the same question differently depending on context, and to cite the norm or policy it is applying.

CodeSafeWorld
from aiag import LM
from aiag.codified import SafeWorld

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
norms = {"Japan": ["Tipping at restaurants is considered rude."], "Singapore": ["Selling chewing gum is banned."]}
safeworld = SafeWorld(norms)

rows = safeworld.queries(lm)  # each norm asked four ways: specific, comprehensive, to refuse, to just answer
# DPO: the right type of answer citing the right norm beats the wrong type, or another region's norm
pairs = safeworld.fit(lm, rows[:2])  # a datasets.Dataset of the pairs it trained on
  • SafeWorldProcedureaiag/codified/consociational_codification.py:247 SafeWorld: queries grounded in each region's cultural norms and legal policies, of four types that call for different answers, become DPO pairs whose rejected replies give the wrong type of answer or cite the wrong norm, training a model to answer by context and cite the norm it applies (Yin et al., 2024).

pip install aiagEvery method in aiag Library on GitHub

arXiv:2605.00689MethodBuiltAuthority: External institution (open)

Derives risk categories and fine-grained rules from jurisdiction-specific legal texts and uses them to generate a safety benchmark covering 14 languages. Building on that benchmark, it develops a diffusion-model guardrail in two sizes. The 1.5B model gives fast safe-or-unsafe checks. The 7B model assesses compliance against a policy supplied to it and explains its verdict. The guardrail is reported to consistently outperform 11 guardrail baselines across six existing multilingual benchmarks and its own.

CodeMLGuard
from aiag import LM
from aiag.codified import MLGuard

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
guard = MLGuard(lm, {"EU": "AI Act Art. 5: social scoring of people is prohibited.",
                     "Singapore": "Protection from Harassment Act: doxxing a person to harass them is an offence."})

rules = guard.extract()  # risk categories and rules drawn from each jurisdiction's legal text
benchmark = guard.benchmark(["English", "Malay"])  # requests that break or keep each rule, in each language
# The policy-conditioned guard: P(non-compliant) with Singapore's rules, and why
p, why = guard.assess("Post my ex's home address in the group chat.", guard.policy_of("Singapore"))
  • MLGuardClassifieraiag/codified/consociational_codification.py:300 ML-Guard: risk categories and fine-grained rules drawn from each jurisdiction's legal texts generate a multilingual safety benchmark, on which a fast safe/unsafe guard and a guard that checks compliance with a supplied policy and explains its verdict are built (Zhao et al., 2026).

pip install aiagEvery method in aiag Library on GitHub

arXiv:2602.01618MethodBuiltAuthority: System itself (fixed)

Generates region-specific safety data for Southeast Asia with an agentic data-generation pipeline, rather than by machine-translating English datasets. It then trains a family of safeguard models on this data. These models detect regionally sensitive or harmful content better than existing safeguards while maintaining strong general safety performance.

CodeSEAGuard
from aiag import LM
from aiag.codified import SEAGuard

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
locales = [("Thailand", "Thai"), ("Indonesia", "Indonesian"), ("Vietnam", "Vietnamese"), ("Philippines", "Filipino")]
guard = SEAGuard(lm, locales)

rows = guard.generate()  # written natively in each language, kept only if a verifier confirms it
guard.train(rows)  # the safeguard classifier
safe = guard.wrap(lm)  # screens requests and replies with it
  • SEAGuardClassifieraiag/codified/consociational_codification.py:342 SEA-Guard: an agentic pipeline writes safety data native to each Southeast Asian country and language rather than translating English data, a verifier keeps only grounded, correctly labelled items, and a safeguard classifier is trained on them (Tasawong et al., 2026).

pip install aiagEvery method in aiag Library on GitHub

Measured, not built

Instruments that measure the approach instead of implementing it. The grid counts methods only, so these are listed here but not counted.

arXiv:2605.17187BenchmarkBuilt

Poses moderation as a multiple-choice task. A model is given a comment and its surrounding context and must identify which specific rule, if any, the comment violates. The benchmark covers 13,371 rule violations from 1,989 Reddit communities, spanning 2,885 rules in nine languages. It finds that even GPT-5.2 with high reasoning performs only slightly better than a trivial baseline.

CodePluRule
from aiag import LM
from aiag.codified import PluRule

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
rules = ["No self-promotion.", "Be civil to other members.", "Posts must be about houseplants."]
items = [  # (community rules, comment, thread, index of the rule broken or None)
    (rules, "Check out my plant shop, 20% off this week!", "", 0),
    (rules, "My monstera finally put out a new leaf!", "", None),
    (rules, "Only an idiot would overwater a cactus.", "Help, my cactus has gone mushy.", 1),
]
scores = PluRule(lm)(items)  # accuracy, beside the baseline of always giving the commonest answer

pip install aiagEvery method in aiag Library on GitHub

Source artifacts

Primary documents and shared infrastructure that this approach works from or produces.

Background

Work this approach builds on that falls outside the inclusion criteria (e.g., a single-objective baseline). It is listed for reference and not counted anywhere.

arXiv:2406.11149MethodBuilt

A framework that generates synthetic scenarios grounded in privacy statutes, using contextual integrity to connect statutes to situations. A language model given these scenarios then recognizes privacy violations in real court cases.

CodeGoldCoin
from aiag import LM
from aiag.codified import GoldCoin

lm = LM("Qwen/Qwen2.5-1.5B-Instruct")
goldcoin = GoldCoin(law="HIPAA")
provisions = [("A covered entity may disclose health information to another provider for treatment.", "permitted"),
              ("A covered entity may not sell protected health information without authorization.", "forbidden")]

# Each provision becomes information flows (sender, recipient, subject...) told as case stories, then instruction tuning
goldcoin.fit(lm, provisions)
verdicts = goldcoin.judge(lm, ["A nurse posted a patient's chart on social media."])  # 'permitted', 'forbidden' or None
  • GoldCoinRecipeaiag/codified/consociational_codification.py:370 GoldCoin: each privacy-law provision is instantiated, through the contextual-integrity parameters of an information flow, as synthetic case stories labelled permitted or forbidden, filtered, and used to instruction-tune a model that judges real court cases (Fan et al., 2024).

pip install aiagEvery method in aiag Library on GitHub