arXiv:2611.15130v1 cs.CL

한 번 읽고 여러 번 답하기: 공유 문맥 LLM 추론을 위한 병렬 프롬프팅

Read Once, Answer Many: Parallel Prompting for Shared-Context LLM Inference

Zekun Zhao, Jeffrey Flanigan

제출 2026-11-11

저자 비고

arXiv Comments

17 pages, 6 figures. Code: https://github.com/jlab-nlp/parallel-prompting. Project page: https://jlab-nlp.github.io/parallel-prompting/

한국어 초록

LLM 워크로드는 문서 QA, 데이터 레이블링, LLM 기반 평가에서처럼 동일한 긴 문서에 대해 서로 독립적인 많은 질문을 던지는 경우가 있다. 프리픽스 캐싱은 이러한 질의들이 공유하는 중복된 프리필을 제거하지만, 각 디코딩 단계는 여전히 질문마다 문서의 키-값(KV) 캐시를 한 번씩 읽으므로 디코딩은 메모리 대역폭에 의해 제한되며 질문 수에 비례하여 늘어난다. 본 논문은 P개의 질문을 단일 요청의 P개 독립 스트림으로 한꺼번에 디코딩하여 이 문제를 해결하는 병렬 프롬프팅(Parallel Prompting)을 제시한다. 우리 방법에서는 매 단계마다 공유 문서를 모든 P개 스트림을 위해 한 번만 읽고, 어텐션 커널 내부에서 평가되는 스트림 ID 어텐션 마스크가 각 답변이 문서와 자신의 질문에만 조건화되도록 한다. 우리는 기존 파일 세 개에 약 80줄을 추가하고 작은 엔진 패키지를 더하여 SGLang에 병렬 프롬프팅을 구현하였다. 이 마스크는 밀집 텐서를 필요로 하지 않으며, 모든 디코딩 단계는 CUDA 그래프로 캡처되는 고정된 형태를 가진다. CodeLlama-7B, 8k-16k 토큰 문서, 문서당 64-256개 질문 조건에서, 병렬 프롬프팅은 최신 릴리스를 포함한 두 SGLang 릴리스에서 A100의 FlashInfer 백엔드를 사용하는 기본 SGLang보다 3.7배, RTX A6000에서는 5.9-6.0배 빠르다. 동일한 입력으로 측정했을 때, 144회의 모든 실행(GPU 2종 x 릴리스 2종 x 워크로드 6종 x 입력 세트 6종)에서 기본 SGLang보다 빠르다. 코드: https://github.com/jlab-nlp/parallel-prompting

원문 초록

LLM workloads sometimes ask many independent questions about the same long document, as in document QA, data labeling and LLM-based evaluation. Prefix caching removes the redundant prefill shared by these queries, but each decode step still reads the document's key-value (KV) cache once per question, so decoding is bound by memory bandwidth and scales with the number of questions. We present Parallel Prompting, which decodes P questions as P independent streams of a single request all at once, fixing this issue. In our method, every step reads the shared document once for all P streams, and a stream-id attention mask, evaluated inside the attention kernel, keeps each answer conditioned only on the document and its own question. We implement Parallel Prompting in SGLang by adding about 80 lines to three existing files and a small engine package; the mask needs no dense tensor, and every decode step has a fixed shape that is captured as a CUDA graph. With CodeLlama-7B, 8k-16k-token documents and 64-256 questions per document, Parallel Prompting is 3.7x faster than stock SGLang with its FlashInfer backend on an A100 and 5.9-6.0x faster on an RTX A6000, on two SGLang releases, including the most recent release. Timed on identical inputs, it is faster than stock SGLang in all 144 runs (2 GPUs x 2 releases x 6 workloads x 6 input sets). Code: https://github.com/jlab-nlp/parallel-prompting

제출 이력

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

  1. arXiv:2611.15130v1

함께 살펴볼 논문

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

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

토론

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