arXiv:2611.22238v1 cs.AI

문맥에도 비용이 든다: 접두 문맥 캐싱을 사용하는 LLM 코딩 에이전트에서 문맥 추가와 제거의 효과

Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Caching

Zerui Yang, Miaomiao Dong, Quan Xue, Chaorui Zhang, Xuanyu Zheng, Xiyuan Wang, Haolin Ruan, Xueyan Niu, Guangcheng Song, Weixi Zhang, Wei Han, Bo Bai

제출 2026-11-18

한국어 초록

코딩 에이전트는 대화 이력을 언어 모델에 반복해서 보낸다. 유용한 코드를 추가하면 탐색을 줄일 수 있고, 오래된 도구 출력을 제거하면 이후 프롬프트를 줄일 수 있다. 이 변경들이 실제로 과제 해결 비용을 낮추는지 측정한다. SWE-bench Verified, SWE-bench, Loc-Bench에서 공개 모델을 2만 회 넘게 실행했다. 캐시되지 않은 입력, 캐시된 입력, 출력 토큰을 따로 계산했다. 세 가지 결과를 얻었다. 첫째, 주요 근거 제공 실험에서 검색한 코드를 추가하자 읽기 및 검색 명령이 18~34% 줄었다. 그러나 캐시 입력 요금이 비캐시 입력의 10분의 1이면, 해결률에서 측정 가능한 개선 없이 비용이 33~42% 늘었다. 둘째, 오래된 관측을 제거할 때는 비용이 줄거나 늘 수 있었다. 같은 방법으로 캐시 할인이 없으면 19~36% 절감했지만, 캐시 요금이 비캐시 입력의 10분의 1이면 비용이 38~116% 늘었다. 셋째, 프롬프트가 짧아져도 에이전트가 더 많은 단계를 수행할 수 있어 실행 비용이 반드시 낮아지지는 않았다. 동시에 진행한 실험들이 캐시된 접두 문맥을 공유해 비용 비교가 왜곡될 수도 있었다. 이 결과는 문맥 관리 방법을 평가할 때 토큰 가격과 그에 따른 에이전트의 행동을 함께 살펴야 함을 보여 준다.

원문 초록

Coding agents repeatedly send their conversation history to a language model. Adding useful code may reduce search, while removing old tool outputs may shorten later prompts. But do these changes reduce the cost of solving a task? We study this as a measurement problem in more than 20,000 runs of open models on SWE-bench Verified, SWE-bench and Loc-Bench. We account separately for uncached input, cached input and output tokens. Three findings emerge. First, in our main evidence-package experiments, retrieved code reduces read and search commands by 18--34%, but increases cost by 33--42% when cached input costs one tenth of uncached input, without a measurable improvement in resolution. Second, removing old observations can either save money or increase cost: the same approach saves 19--36% without a cache discount but increases cost by 38--116% with a tenth-price cache. Third, shorter prompts do not guarantee cheaper runs because agents may respond by taking more steps. We also find that concurrent experiments can share cached prefixes and distort cost comparisons. These results show why context-management methods should be evaluated using both token prices and the agent's subsequent behavior.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2611.22238v1제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.