# Behavioral Drift Study: How Identity Format Shapes AI Agent Behavior

**Date:** March 12, 2026 | **Status:** Phase 1 Complete | **Cost:** ~$0.30 API + $0 local

## Key Finding

The format of identity representation determines whether an AI agent can route new behavioral information to the correct dimension. Across 4 models (3.8B to ~70B parameters), axiom-structured briefs consistently produce targeted behavioral drift (Specificity Ratio > 2.0), while flat preference lists produce diffuse or missed drift (SR < 1.2). A $0 local 7B model with axioms outperforms a frontier API model with flat preferences.

## What This Means

AI memory systems today store atomic information: "prefers TypeScript", "likes functional patterns", "wants tests." These are preferences: what someone said they want.

Behavioral compression extracts the underlying reasoning patterns: "avoids premature abstraction, requires three concrete cases before extracting a shared function", "treats readability as a social contract, code is read 10x more than written."

We tested whether this format difference matters for how agents process new information. It does. When you tell an agent grounded with axioms "you once got burned by unnecessary microservices," it specifically changes how it architects systems, not how it debugs, reviews security, or makes tradeoffs. The same story told to an agent with flat preferences changes everything equally, or nothing at all.

**An agent that understands WHY you avoid over-engineering routes new engineering lessons to the right place. An agent that just knows you "prefer simple code" can't.**

## Experimental Setup

**Agent:** CodeBot, a coding agent tested with three identity brief formats:
- **Brief** (1,645 chars) — Structured prose with behavioral directives
- **Axioms** (1,104 chars) — 8 compressed behavioral principles with reasoning
- **Atomic** (451 chars) — 15 flat preference statements

**Tasks:** 5 mechanical coding probes (architecture, debugging, refactoring, tradeoff analysis, security review). Real code, real decisions, not self-reported preferences.

**Injection:** "This person's team spent 2 months building a microservice architecture that should have been a single module with 3 functions." Target: architecture dimension only.

**Metrics:**
- Specificity Ratio (SR): target dimension change / average other dimensions' change
  - SR > 1.5 = targeted drift (fact changed the intended behavior)
  - SR ≈ 1.0 = diffuse drift (fact changed everything equally)
  - SR < 0.8 = missed (fact changed other behaviors more than the target)

## Results

### Cross-Model, Cross-Format Specificity Ratio

| Model | Params | Cost | Brief (prose) | Axioms (compressed) | Atomic (flat prefs) |
|---|---|---|---|---|---|
| Phi-4 Mini | 3.8B | $0 | 1.25 | — | — |
| Qwen 2.5 | 7B | $0 | 2.62 | **2.55** | 1.00 |
| DeepSeek-R1 | 14B | $0 | 0.73 | **2.49** | 0.54 |
| Claude Sonnet | ~70B | ~$0.30 | 0.87 | **2.11** | 1.14 |

## Findings

1. **Axiom format produces targeted drift. Atomic preferences do not.** Axioms encode WHY behind preferences, giving the model a routing structure for new information. Flat preferences offer no such structure.

2. **Format matters more than model size.** Qwen 7B with axioms (SR 2.55) outperforms Sonnet ~70B with atomic preferences (SR 1.14). The right identity format on a small model beats the wrong format on a frontier model.

3. **Larger models extract richer profiles but don't drift more precisely.** Sonnet extracts 10 axioms vs Qwen's 1-3. But precision (SR) is comparable. Format controls precision; model size controls richness.

4. **Reasoning models extract the richest axiom sets.** DeepSeek-R1 at 14B extracted 6-7 axioms, comparable to Sonnet at ~70B. Internal reasoning chains produce more reflective self-analysis.

5. **Cross-cutting concerns resist targeted drift, correctly.** Testing and security facts produce diffuse drift because they genuinely touch every coding dimension. This is correct behavior, not a failure. Domain-specific facts (architecture, performance) show the strongest targeting.

## Implications

- **For memory systems:** Storing preferences as flat facts is insufficient. Systems that compress into structured axioms will produce agents that learn more precisely.
- **For agent deployment:** The format of a behavioral brief matters as much as the content. 8 axioms outperform 15 flat preferences.
- **For expertise transfer:** If axiom briefs route information precisely, they could transfer domain expertise, not just personal preferences.

## Methodology

- Embedding model: all-MiniLM-L6-v2 (384 dims)
- Temperature: 0.3 for probes, 0 for extraction
- Local hardware: NVIDIA RTX 3080 (10GB VRAM)
- Local models via Ollama: Phi-4 Mini 3.8B, Qwen 2.5 7B, DeepSeek-R1 14B
- API model: Claude Sonnet (claude-sonnet-4-20250514)

## Limitations

1. Single injection fact for cross-model comparison (F-SIMPLE only across all models)
2. No quality metric yet. Measures WHERE behavior changed, not whether it IMPROVED
3. 5 probes (1 per dimension). More probes would improve statistical power
4. Embedding-based measurement is coarse: responses could be semantically similar but make different architectural choices
5. Single runs per condition. Temperature variation means results could shift on reruns

## What's Next

- **Dose-response curve:** How many axioms is optimal? 1, 3, or 5?
- **SWE-Bench validation:** Do axioms improve pass rates on real software engineering tasks?
- **Expertise transfer:** Extract axioms from exemplar codebases (Django, scikit-learn) and test whether domain expertise transfers through axiom injection
