vLLM Hook v0: 一种用于编程vLLM内部模型的插件
vLLM Hook v1: A Plug-in for Programming Model Internals on vLLM
AI总结:
vLLM Hook v0 提供了一种插件,用于编程vLLM模型的内部状态,支持被动和主动编程,以增强模型的可编程性和功能。
摘要:
现代人工智能(AI)模型被部署在推理引擎上,以优化运行时效率和资源分配,特别是在基于变压器的大型语言模型(LLMs)中。vLLM项目是一个主要的开源库,用于支持模型服务和推理。然而,当前的vLLM实现限制了部署模型内部状态的可编程性。这阻止了流行的时间测试模型对齐和增强方法的使用。例如,它阻止了基于注意力模式检测对抗性提示或根据激活引导调整模型响应。为弥补这一关键差距,我们提出了vLLM Hook,一个开源插件,用于启用vLLM模型的内部状态编程。基于一个指定要捕获的内部状态的配置文件,vLLM Hook为vLLM提供无缝集成,并支持两个关键功能:被动编程和主动编程。对于被动编程,vLLM Hook会探测所选的内部状态以供后续分析,同时保持模型生成的完整性。对于主动编程,vLLM Hook通过改变所选的内部状态来实现对模型生成的高效干预。除了展示vLLM Hook的核心功能外,在版本0中,我们还展示了三个使用案例,包括提示注入检测、增强的检索增强检索(RAG)和激活引导。最后,我们欢迎社区通过https://github.com/ibm/vllm-hook贡献以改进vLLM Hook。
英文摘要:
Modern artificial intelligence models are deployed on inference engines to optimize runtime efficiency and resource allocation, particularly for transformer-based large language models. The vLLM project is a major open-source library to support model serving and inference. However, the current implementation of vLLM limits programmability of the internal states of deployed models. This prevents the use of popular test-time model alignment and enhancement methods. For example, it prevents the detection of adversarial prompts based on attention patterns or the adjustment of model responses based on activation steering. To bridge this critical gap, we present vLLM Hook, an opensource plug-in to enable the programming of internal states for vLLM models. Based on a configuration file specifying which internal states to capture, vLLM Hook provides seamless integration to vLLM and supports two essential features: passive programming and active programming. For passive programming, vLLM Hook probes the selected internal states for subsequent analysis, while keeping the model generation intact. For active programming, vLLM Hook enables efficient intervention of model generation by altering the selected internal states. In version 1 (named vLLM Hook MIA), the plugin runs on vLLM's V2 model runner and preserves the engine's CUDA graphs, so that capturing and steering internal states incurs only a small decoding overhead. It supports both offline use and serving through vllm serve. In addition to presenting the core functions of vLLM Hook, we demonstrate use cases including prompt injection detection, attention-based re-ranking for retrieval-augmented generation, activation steering, hidden-state probing, hallucination detection, schema linking for text-to-SQL, and tool-call risk assessment. Finally, we welcome the community's contribution to improve vLLM Hook via https://github.com/IBM/vLLM-Hook.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。