llm-agents deepseek-r1 context-management llama-3-1-70b compression-stress-test reasoning-trace-confound probe-gated-resurfacing plan-persistence
Abstract
Long-horizon agents depend on context management: systems compress, summarize, and evict old tokens so tasks can continue beyond finite windows. That is safe only when dropped information is no longer needed or has been internalized. Plans are the stress case: they are written early, used for many steps, and first to be evicted. We introduce replay pairing, a diagnostic that runs the same trajectory with and without the plan in history and measures hidden-state cosine distance. On Llama-3.1-70B, plan signal spikes to 0.453 one step after the plan, then falls 4.1x in a single action-observation step; HotpotQA falls 12.4x. This is evidence that standard LLM agents do not carry plans forward as persistent state, and instead depend on the plan remaining in context. A layer-L32 probe detects this decay as a diagnostic, not as proof that it reads plan content itself. Reasoning models add a measurement confound: their `<think>` traces re-derive plan content, so standard stripping leaves plan evidence in the stripped condition. We name this the reasoning-trace confound and fix it with strict stripping, which removes prior `<think>` blocks from the stripped run only. It recovers +163% of the step+1 signal in-sample and +153% held out, while not meaningfully changing non-reasoning Llama (+4.8%). On DeepSeek-R1-Distill-Llama-70B, a Llama-trained probe transfers at AUROC 0.748 (p=6e-4), while R1-specific probes reach 1.000, suggesting R1 encodes plan signal in a different hidden-state direction. Finally, a compression stress test shows the practical cost: naive plan eviction cuts ALFWorld success by 34.7pp, while probe-gated re-surfacing does not recover it. The contribution is a measurement and stress-test framework showing that agent-critical information can be context-resident rather than persistent. Context management is load bearing, but plan protection alone is not enough.
한국어 요약
한 줄 요약
LLM 에이전트는 계획 정보가 컨텍스트에 남아 있어야 지속적으로 작동하며, 이를 관리하는 것이 성능에 직접적으로 영향을 미친다.
핵심 기여도
- **Replay pairing**이라는 진단 방법을 제안하여, LLM 에이전트의 계획 정보 유지 능력을 측정.
- **Llama-3.1-70B**에서 계획 정보의 히든 스테이트 코사인 유사도가 단 1단계 후 4.1배 감소함을 확인.
- **HotpotQA** 데이터셋에서는 12.4배 감소함을 보여, 기존 에이전트가 계획을 지속 상태로 유지하지 못함을 입증.
- **Reasoning-trace confound** 문제를 제시하고, 이를 해결하기 위한 **strict stripping** 방법을 제안.
핵심 아이디어
기존 LLM 에이전트는 긴 텍스트를 처리하기 위해 토큰을 압축하거나 제거하지만, 이 과정에서 중요한 계획 정보가 손실될 수 있다.
연구팀은 **replay pairing**이라는 진단 기법을 통해, 동일한 작업을 '계획 포함'과 '계획 제거' 두 가지 조건에서 실행한 후 히든 스테이트의 유사도를 비교함으로써, 계획 정보가 실제로 지속적으로 유지되는지 확인했다.
또한, 추론 과정에서 생성된 `thought` 텍스트가 계획 정보를 재생성하는 문제인 **reasoning-trace confound**를 발견하고, 이를 해결하기 위해 `thought` 블록만 제거하는 **strict stripping**을 제안했다.
기술적 접근법
- **Replay pairing**: 동일한 작업을 두 가지 조건(계획 포함/제거)으로 실행하고 히든 스테이트의 코사인 유사도를 비교.
- **Layer-L32 probe**: 히든 스테이트에서 계획 정보의 감소를 진단.
- **Strict stripping**: `thought` 블록만 제거하여 reasoning-trace confound를 제거.
- **DeepSeek-R1-Distill-Llama-70B** 모델에서 AUROC 0.748 (p=6e-4)의 성능을 보이는 Llama 기반 probe를 사용.
주요 결과
- **Llama-3.1-70B**에서 단 1단계 후 계획 정보 유사도가 4.1배 감소 (HotpotQA는 12.4배).
- **Strict stripping**은 in-sample에서 +163%, held-out에서 +153%의 신호 회복 성능을 보임.
- **DeepSeek-R1-Distill-Llama-70B**에서 AUROC 0.748 (p=6e-4)의 성능을 보이며, R1-specific probe는 1.000에 도달.
- **ALFWorld**에서 단순한 계획 제거는 성공률을 34.7pp 감소시킴.
의의 및 한계
이 연구는 LLM 에이전트가 중요한 정보를 지속 상태로 유지하지 못하고, 대신 컨텍스트에 의존한다는 사실을 입증함으로써, 컨텍스트 관리가 성능에 직접적인 영향을 미친다는 점을 강조한다.
그러나 이 연구는 특정 모델과 데이터셋에서의 결과를 기반으로 하며, 다른 아키텍처나 작업에서 동일한 현상이 나타나는지는 추가 연구가 필요하다.
또한, **probe-gated re-surfacing**은 계획 정보를 복구하지 못함을 보여, 단순한 계획 보호만으로는 부족함을 드러낸다.
실용적 활용
이 연구는 대규모 언어 모델 기반 에이전트의 컨텍스트 관리 전략 설계에 중요한 지침을 제공한다.
특히, **긴 작업 수행 시 계획 정보의 유지**가 필수적인 상황, 예를 들어 **자동화된 고객 서비스 시스템**이나 **복잡한 태스크 자동화 플랫폼**에서 활용 가능하다.
또한, **모델 성능 진단 및 개선**을 위한 새로운 프레임워크를 제시한다.