
After studying this material, you should be able to:
Imagine deploying an AI agent to make financial decisions, medical recommendations, or compliance checks. You immediately face four simultaneous demands:
| Requirement | What It Means | Why It's Hard |
|---|---|---|
| Trustworthiness | System behaves reliably and safely | LLMs can hallucinate or be inconsistent |
| Explainability | Humans can understand why a decision was made | Neural networks are black boxes |
| Consistency | Same input → same output, every time | LLMs are probabilistic by nature |
| Adaptability | System handles new, unseen situations | Hard-coded rules become outdated |
Manual Expert Audit → Slow, expensive, doesn't scale
Supervised Classifiers → Black box, not explainable
Hard-coded Rule Systems → Rigid, can't adapt to new situations
Key Insight: No single existing approach satisfies all four requirements simultaneously. This paper proposes a unified framework that does.
Rules are powerful because they are:
Instead of asking an LLM to make decisions directly (unpredictable), the framework:
Step A: LEARN rules from data using an LLM
Step B: APPLY those rules to make decisions
Step C: EXTEND rules when new situations arise
This separates learning from deciding, which is the architectural breakthrough.
This module extracts rules from labeled data — both rules that are explicitly stated and rules that are implied but never written down.
1. Start with labeled examples (input → correct output)
2. LLM attempts to classify examples
3. When LLM makes an ERROR → analyze why
4. Use Chain-of-Thought prompting to extract a rule
5. Add rule to the rule library
6. Repeat iteratively
7. Prune the rule library
CoT prompting forces the LLM to reason step by step before giving an answer.
Without CoT:
Input: "Transaction X matches Record Y?"
LLM: "Yes"
With CoT:
Input: "Transaction X matches Record Y? Think step by step."
LLM: "Transaction X has amount $500. Record Y has amount $500.
The dates differ by 1 day, which is within tolerance.
The reference codes match. Therefore: Yes, they match."
The reasoning chain reveals implicit knowledge that can be turned into a rule:
"IF amounts match AND date difference ≤ 1 day AND reference codes match → RECONCILE"
| Type | Definition | Example |
|---|---|---|
| Explicit | Directly stated in documentation | "Amounts must match exactly" |
| Implicit | Unstated but practiced by experts | "A 1-day date difference is acceptable" |
Key Insight: CoT prompting is the mechanism that surfaces implicit knowledge — the kind that lives in experts' heads but was never written down.
After collecting many rules, you need to select the best minimal set.
The Problem: 100 rules might be redundant. You want the fewest rules that cover the most cases.
The Solution — Set Cover Logic:
Imagine each rule "covers" certain training examples.
Goal: Select minimum number of rules to cover maximum examples.
Rule A covers: cases 1, 2, 3, 5
Rule B covers: cases 2, 3, 4, 6
Rule C covers: cases 1, 5, 7
Greedy approach:
→ Pick Rule A (covers most new cases: 1,2,3,5)
→ Pick Rule B (covers most remaining: 4,6)
→ Pick Rule C (covers 7, but 1,5 already covered)
→ Stop when coverage gain is minimal
Why "Greedy"? At each step, pick the rule with the highest marginal utility. It's not globally optimal but computationally efficient.
Result: A minimal, high-utility rule set — small enough to be auditable, large enough to be effective.
This module makes decisions by applying the learned rules to new inputs.
New Input arrives
↓
Match against rule library
↓
Find applicable rule/s
↓
Apply rule → Generate prediction
↓
Produce auditable reasoning trace
This is what makes the system explainable and trustworthy.
Example output:
Decision: RECONCILE
Rule Applied: Rule #14
Rule: "IF amount difference < 0.01% AND same counterparty
AND date within 2 days → RECONCILE"
Reasoning: Amount difference = 0.005% [PASS]
Counterparty = "ABC Corp" on both [PASS]
Date difference = 1 day [PASS]
Confidence: HIGH
Key Insight: Every decision comes with a paper trail. A human auditor can review exactly which rule fired and why. This is fundamentally different from a neural network saying "confidence: 87%."
This module handles out-of-distribution (OOD) data — cases that no existing rule covers.
Existing rules handle: situations A, B, C, D
New situation E arrives → No rule matches → What happens?
Without this module: System fails or defaults to uncertain LLM judgment
With this module: System infers a new rule from situation E
OOD case detected (no rule matches)
↓
LLM analyzes the case deeply
↓
LLM proposes a candidate new rule
↓
Rule is validated (against labeled examples if available)
↓
Rule added to library autonomously
↓
Future similar cases are now handled consistently
This is the adaptability component. Real-world environments change:
The system learns continuously rather than requiring manual rule updates.
Result from paper: 50% of OOD samples yielded valid new rules — meaning the system successfully extended its own knowledge in half of novel situations.
What is record reconciliation? Matching financial transactions across different systems to confirm they represent the same real-world event. This is a high-stakes, rule-intensive, real-world task — perfect for testing this framework.
Hard-coded rule baseline: 85% accuracy
This framework: 92% accuracy
↑
+7% improvement
An ablation study removes one component to measure its contribution.
Framework WITHOUT rule library: 84% accuracy
Framework WITH rule library: 92% accuracy
↑
+8% from rules alone
Interpretation: The rule library acts as a "consistency anchor" — it prevents the LLM from drifting or being inconsistent. Without it, the LLM makes decisions case-by-case (variable). With it, the LLM is constrained to follow established rules (consistent).
How data is formatted affects rule quality.
"$1,000.00" vs "1000" vs "1000.00 USD"
The same value represented differently can confuse rule matching. Preprocessing and standardization are critical.
Too few rules → Poor coverage, many OOD cases
Too many rules → Overlapping, contradictory, hard to audit
The pruning step addresses this, but finding the right balance requires ongoing tuning.
In production, you often don't know the correct answer immediately.
Traditional monitoring: Compare prediction to ground truth
Production reality: Ground truth may arrive days/weeks later
or never
Strategies discussed:
┌─────────────────────────────────────────────────────┐
│ LLM-BASED RULE LEARNING FRAMEWORK │
│ │
│ ┌──────────────────┐ │
│ │ MODULE 1 │ Labeled data → Rules │
│ │ Rule Induction │ (CoT + Error-driven + │
│ │ │ Set-cover pruning) │
│ └────────┬─────────┘ │
│ │ Rule Library │
│ ↓ │
│ ┌──────────────────┐ │
│ │ MODULE 2 │ Input + Rules → Decision │
│ │ Rule Deduction │ + Auditable reasoning trace │
│ └──────────────────┘ │
│ │
│ ┌──────────────────┐ │
│ │ MODULE 3 │ OOD Input → New Rules │
│ │ Rule │ (Autonomous generalization) │
│ │ Generalization │ │
│ └──────────────────┘ │
└─────────────────────────────────────────────────────┘
| Requirement | Module 1 | Module 2 | Module 3 |
|---|---|---|---|
| Trustworthiness | Grounds decisions in validated rules | Audit trail per decision | Validates new rules before use |
| Explainability | Rules are human-readable | Reasoning trace shown | New rules are interpretable |
| Consistency | Rule library as anchor | Same rule → same output | Consistent handling of new cases |
| Adaptability | Learns from limited data | — | Extends rules autonomously |
Test yourself with these questions:
Why can't you just use a raw LLM for high-stakes decisions without a rule library?
Because LLMs are probabilistic — same input can yield different outputs, and there's no audit trail.
What is the role of Chain-of-Thought prompting in rule induction?
It forces step-by-step reasoning, which surfaces implicit knowledge that can be formalized into rules.
What does "greedy set-cover pruning" accomplish?
It selects the minimum number of rules that cover the maximum number of training cases, keeping the rule library compact and auditable.
What happens when an input matches no existing rule?
Module 3 (Rule Generalization) activates, and the LLM attempts to infer a new valid rule from the case.
Why is the +8% accuracy gain from the ablation study significant?
It proves the rule library itself — not just the LLM — is responsible for improved consistency and accuracy.