Prompt compression is an innovative method for efficiently condensing input prompts while preserving essential information. To facilitate quick-start services, user-friendly interfaces, and compatibility with common datasets and metrics, we present the Prompt Compression Toolkit (PCToolkit). This toolkit is a unified plug-and-play solution for compressing prompts in Large Language Models (LLMs), featuring cutting-edge prompt compressors, diverse datasets, and metrics for comprehensive performance evaluation. PCToolkit boasts a modular design, allowing for easy integration of new datasets and metrics through portable and user-friendly interfaces. In this paper, we outline the key components and functionalities of PCToolkit. We conducted evaluations of the compressors within PCToolkit across various natural language tasks, including reconstruction, summarization, mathematical problem-solving, question answering, few-shot learning, synthetic tasks, code completion, boolean expressions, multiple choice questions, and lies recognition.
翻译:提示压缩是一种高效压缩输入提示同时保留关键信息的创新方法。为提供快速启动服务、友好的用户界面以及通用数据集与评估指标的兼容性,我们提出了提示压缩工具包(PCToolkit)。该工具包是为大型语言模型(LLMs)设计的统一即插即用解决方案,集成了先进的提示压缩器、多样化数据集及全面性能评估指标。PCToolkit采用模块化设计,通过便携且友好的接口支持新数据集与指标的无缝集成。本文阐述了PCToolkit的核心组件与功能,并在多项自然语言任务中对内置压缩器进行了评估,涵盖重构、摘要、数学问题求解、问答、少样本学习、合成任务、代码补全、布尔表达式、多项选择题及谎言识别。