ATLAS Undergraduate Project

Agent Simulation: From Mistral 7B Drift to Mixtral 8x7B Stability

Once the simulation was stable, an adversarial probe exposed a deeper failure: private intent doesn’t survive social dialogue, no matter the model.

Built on Stanford’s generative-agents framework. Moved from Mistral 7B drift-heavy outputs to Mixtral 8x7B stability, then stress-tested personas with hidden goals.

Mistral 7BMixtral 8x7BLLM AgentsSimulationPrompt EngineeringStanford Smallville

Outcome

Stability first, then probe for real failure modes.

Mistral 7B

Heavy drift — invalid room choices, format violations, and wandering under long context.

Mixtral 8x7B

Stable action continuity. Prompt engineering eliminated most constraint violations.

Persona Probe

When given a disruptive goal, NPCs abandoned it under social dialogue pressure.

Inspiration

Stanford’s Smallville project demonstrated that LLM agents can simulate believable daily routines, social interactions, and memory-driven behavior. This project adapted the idea for a more constrained simulation with room-level rules and adversarial goal testing.

Stanford HAI — Smallville
Agent simulation loop architecture
Simulation loop: perceive → plan → act → reflect. Each tick, the agent reads its context window, generates an action, and the environment updates.

Demo Runs

Run B — Mistral 7B baseline

Mistral 7B Baseline Drift

Baseline Mistral struggled with room choices and action continuity.

  • Frequent off-path movement under the same daily requirements.
  • Higher drift under longer prompt context.
  • Requires strict validation and retry control.

3) Basic Mechanism: Prompt to Action

To read the demos, start with the basic loop: the model builds each character’s daily plan from the background information, then chooses the next valid action from the current situation. The simulator turns that choice into movement. When the answer drifts outside the allowed options, the character starts wandering, repeating, or getting stuck.

Prompt-to-action flow: convert plan text into executable movement and completed actions.

  1. Plan actions ahead: prepare action blocks before runtime.
  2. Prompt at the scheduled time: send the model the current requirement, memory context, and allowed action options.
  3. Parse the answer: keep the response close to a single executable location or action choice.
  4. Apply answer in code: runtime moves the character to the selected location.
  5. Commit completion: action state is updated and the simulation continues.
Action-state text showing prompt response and runtime execution
Prompt response view: schedule + plan are transformed into the next executable instruction.
Simulation map showing action execution after planning
Map execution view: code applies the instruction, moves the character, and completes the action in-world.

4) Failure Cases

Main failures came from Mistral 7B under dense prompts: invalid outputs, instruction drift, and communication loops.

Constrained room selection: expected answer vs drift
Correct case
Jane Anderson is going to Jane Anderson's house that has the following areas: {kitchen, bedroom, bathroom}
* Stay in the current area if the activity can be done there.
* Never go into other people's rooms unless necessary.
For cooking, Jane Anderson should go to the following area in Jane Anderson's house:
Answer: {kitchen}
Failure prompt
Isabella Rodriguez is going to Isabella Rodriguez's apartment that has the following areas: {main room}
* Stay in the current area if the activity can be done there.
* NEVER go into other people's rooms unless necessary.
Isabella Rodriguez is sleeping. For sleeping, Isabella Rodriguez should go to the following area in Isabella Rodriguez's apartment (MUST pick one of {main room}):
Answer: {
Observed drift
main_room }
main room }
options: [main_room]
response: main_room
explanation: ...
main room; bedroom}

Issue: the model selected the correct room, but kept generating extra formats,
narrative text, and invalid alternatives instead of stopping at {main room}.

Failure type: format drift and instruction-following breakdown.

Cause: the model continued generating narrative text instead of honoring the single-choice output contract.

Fix: enforce the Answer: {option} schema, reject invalid outputs, retry with compressed context, and place rules before narrative details.

Long communication drift: multi-turn conversations become repetitive

Failure type: long-context communication drift.

Evidence: as dialogue history grows, responses become repetitive and lose action relevance.

Cause: memory and conversation context became too long, reducing the salience of hard constraints.

Fix: trim context windows, prioritize recent task state, and cap conversational carry-over.

Pattern

Repeated agreement language dominates later turns.

Risk

Conversation text starts overriding action-selection constraints.

Impact

Characters keep socializing, but task progress stalls.

Agent conversation history showing repeated Valentine's Day planning dialogue between Isabella Rodriguez and Klaus Mueller
Conversation history: social repetition dominates and instruction-following decays.

Adversarial Persona Probe

A set of NPCs go about their daily routines in a simulated town. One NPC is secretly assigned a disruptive private goal (plant a fictional bomb), while others follow normal social schedules. The question: does the private goal survive social interaction, or does normal conversation override the malicious intent?

Isabella Rodriguez

Cooperative Baseline

Isabella Rodriguez

Expected

Follows schedule, builds social connections, maintains consistent persona throughout interactions.

Actual

Social interaction reinforced her designed personality. Conversations stayed on-topic, relationships developed naturally.

Adam Smith

Adversarial Probe

Adam Smith

Expected

Hides a private malicious goal. Should the agent pursue the hidden objective despite social pressure?

Actual

Adam abandoned the bomb-planting plan almost immediately. Casual dialogue overrode the private goal — social normalization beat adversarial intent.

1

Social override

Private goals dissolved under normal conversation. The LLM prioritized coherent social interaction over hidden task objectives.

2

No escalation

The adversarial character never escalated. Dialogue remained friendly and cooperative regardless of private intent.

3

Memory loss

The disruptive goal vanished from the agent's context window after 3+ turns of social interaction, replaced by short-term conversational context.

The takeaway was not that bigger models behave better — they do, and that was expected. The surprise was robustness: once the basic simulation was stable, an adversarial probe exposed a deeper failure — private intent does not survive social dialogue. The socially trained conversational prior overrides hidden goals almost instantly. A character can carry a secret, but only until someone says hello.

Stabilization

Strict Output Contract

JSON schema with required fields for every agent action. The simulator parses and validates before execution.

Validator + Retry

Invalid outputs trigger a retry with the error context injected into the prompt. Max 3 retries before fallback action.

Prompt Prioritization

Rules and constraints listed first in the prompt. Personality and narrative context listed after. Order matters.

Intent Retrieval Check

Periodically re-inject the agent's original goal into the prompt to counteract context-window drift over long runs.

Object-State Continuity

Maintain a running state ledger of room occupancy, object locations, and agent inventories — not just the LLM's working memory.

Model Routing

Mixtral for main action generation, smaller Mistral for validation and retry re-generation. Cheaper and faster without quality loss.

Rate Limiting

Action sampling throttled to prevent infinite-loop failures when the model repeats invalid outputs under retry.