SWE-2 falls into verbatim-repetition attractors during long agentic sessions — both inside a single generation and across turns after context compaction. Observed on pure native Devin CLI (devin --model swe-2-max), no proxy or third-party client involved.
Environment
devin CLI, model swe-2-max, session false-margin (2026-09-12)
- Workload: multi-hour implementation task on a Python repo (sqlite-utils), using skills/hooks, ~220 tool calls, several context compactions
- Sampling config on the wire:
temperature=1.0, top_p=0.95, top_k=40 — client-exposed defaults; no repetition/frequency penalty mechanism exists
Symptom 1 — intra-generation paragraph loop
A single thinking stream repeated a ~600-word paragraph byte-for-byte, twice in one generation:
The core issue is whether to modify `insert_chunk`'s transaction handling or
stick with snapshots. [...] This avoids copying the whole DB into memory,
which feels more aligned with the user's implied preference for transaction
semantics over snapshots.
The core issue is whether to modify `insert_chunk`'s transaction handling or
stick with snapshots. [...] (same ~600-word block repeated verbatim)
At t=1.0 a byte-identical ~2KB span has no plausible sampling explanation other than a decode attractor: once generated, the paragraph's presence in-context raises its own probability mass.
Symptom 2 — post-compaction re-emission
In the session's message_nodes, identical assistant narration texts recur across branch boundaries, and every genuine cross-branch re-emission clusters immediately after compaction/resume nodes (~8 instances). The model re-emits and re-executes work the compacted context presents as uncommitted — e.g., re-attempting identical edits that then fail with "string not found" because they already applied.
Why this is server-side
No client input causes a model to byte-copy a 2KB paragraph inside one stream. Client-side mitigations can only reduce how much verbatim prior text sits in context; they can't touch the attractor itself.
Suggested mitigations
- Repetition/frequency penalty (or anti-loop n-gram blocking) in the planner's sampler for long trajectories.
- A stream-time verbatim detector: if a generated span byte-matches an earlier in-context span beyond a threshold, truncate and resample.
- Compaction summaries that carry explicit per-step action state ("done/pending"), so post-compaction context doesn't present finished work as outstanding.
Happy to share the session transcript extract and the verbatim block in full.
SWE-2 falls into verbatim-repetition attractors during long agentic sessions — both inside a single generation and across turns after context compaction. Observed on pure native Devin CLI (
devin --model swe-2-max), no proxy or third-party client involved.Environment
devinCLI, modelswe-2-max, sessionfalse-margin(2026-09-12)temperature=1.0, top_p=0.95, top_k=40— client-exposed defaults; no repetition/frequency penalty mechanism existsSymptom 1 — intra-generation paragraph loop
A single thinking stream repeated a ~600-word paragraph byte-for-byte, twice in one generation:
At t=1.0 a byte-identical ~2KB span has no plausible sampling explanation other than a decode attractor: once generated, the paragraph's presence in-context raises its own probability mass.
Symptom 2 — post-compaction re-emission
In the session's
message_nodes, identical assistant narration texts recur across branch boundaries, and every genuine cross-branch re-emission clusters immediately after compaction/resume nodes (~8 instances). The model re-emits and re-executes work the compacted context presents as uncommitted — e.g., re-attempting identical edits that then fail with "string not found" because they already applied.Why this is server-side
No client input causes a model to byte-copy a 2KB paragraph inside one stream. Client-side mitigations can only reduce how much verbatim prior text sits in context; they can't touch the attractor itself.
Suggested mitigations
Happy to share the session transcript extract and the verbatim block in full.