-
Notifications
You must be signed in to change notification settings - Fork 0
Local LLM Limitations: Entity Contagion & Drift
While open-source local LLMs (even in the mid-weight 26B–35B parameter range) have improved drastically, they still hit hard architectural and capacity ceilings when tracking detailed, multi-entity states over long contexts.
Entity Contagion & Latent Feature BleedingIn mid-weight local LLMs (26B–35B), entity tracking relies on dynamic attention routing across context windows. When narrative tokens intervene between an entity and its assigned attributes, attention weights decay. When the model encounters overlapping semantic concepts (e.g., music, relationships, male leads), a failure mode called Entity Contagion (or Latent Feature Bleeding) occurs.
Rather than maintaining a isolated database of characters, the model calculates the next token based on statistical proximity. The associative bridge between Band -> Guitarist -> Male Character collapses into the most active entity in the working memory.Illustrative Example:
Chris: [Role: Guitarist, Band Member]
Mike: [Role: Childhood Friend, Non-Musician]
Valerie:[Role: Lead/Protagonist]Valerie stepped off the stage, her heart still pounding from the set. The guitars had sounded incredible tonight. She grabbed a water bottle and saw Mike standing near the exit..."
graph TD
Sub1[Chris = Guitarist] -->|Decay over Distance| Trait[Floating Trait: Guitarist]
Context[Valerie thinks of Mike...] --> Subject[Active Subject: Mike]
Trait -->|Attention Bleeding| Bridge[High Token Proximity]
Subject -->|Direct Context Proximity| Bridge
Bridge -->|Faulty Binding| Result[Failure: Mike becomes Guitarist]
Mechanism: As the model decodes the scene involving Mike, the high-activation latent features for [Band] and [Guitarist] are floating unanchored in short-term context memory. Because Mike is the active subject, the attention mechanism erroneously binds these floating traits to him.
Resulting Output:
"Mike adjusted the strap of his guitar and smiled at Valerie as she approached." (Failure: Chris's role permanently bled into Mike's entity state).
Key Technical Takeaways
-
Positional Distance vs. Semantic Association: The model prioritizes immediate proximity of entities (
Mike) over distant structured constraints (Chris = Guitarist). -
Soft Bounding Failures: Negative rules (e.g., "Do not make Mike the guitarist") fail because transformer attention attends heavily to the words Mike and Guitarist, inadvertently reinforcing the incorrect connection.
-
Limited Parameter Capacity for Entity Mapping: A 26B/35B model has a restricted number of attention heads dedicated to high-dimensional state tracking. When storing complex YAML-like relational trees, the model frequently suffers from "entity bleeding," where attributes (e.g., "guitarist") disconnect from their primary entity ("Chris") and attach to the most active subject in the immediate generation window ("Mike").
-
Superficial Context Retrieval (Lost in the Middle): Local models often process system prompts or long YAML blocks as background tokens rather than strict database constraints. Information tucked in the middle of long prompts gets diluted by the attention mechanism, causing the model to prioritize conversational flow and local token probability over hard structured data.
-
Instruction Drift & Rule Overriding: System prompts and explicit guardrails are soft constraints in transformers, not hard programming rules. Under creative text generation, auto-regressive decoding favors narrative momentum and high-probability language patterns over strict negative constraints, rendering system rules ineffective over extended outputs.
-
Supervised Fine-Tuning (SFT) Bias: Most local models are heavily fine-tuned on general storytelling or chat datasets where common tropes (e.g., "the male lead is in the band") are mathematically overrepresented. When a model experiences even a slight drop in attention accuracy, it defaults to these training tropes.
-
Lack of Active State-Verification: Unlike multi-agent enterprise setups, local models generate output in a single forward pass. They lack built-in secondary checking passes to validate generated attributes against the source schema before outputting text.
Flatten the State Schema: Instead of nested YAML structures, use explicit, flat sentences in the context (e.g., "Chris is the ONLY guitarist in the band. Mike is NOT a guitarist.").
Pre-fill / Post-Processing Logic: Run a lightweight secondary local pass (e.g., a fast 8B model or regex validator) specifically tuned to flag character trait inconsistencies before displaying the output.